My data has 5 blocks . Within each block, the same 3 sub-blocks (1,2,3)are applied to each individual.

I want to examine the the effects of the blocks and sub-blocks.

model <- lmer(yield ~ (1|block) + (1|subblock), data=myData )

I am having trouble on labelling the sub-block data, since I do not know how I should label the sub-block data ?

What would the difference be if I label the subblock as below (left vs right) ? How would the interpretation be different ?

enter image description here


1 Answer 1


If these are nested data, that is if subblock 1 in Block 1 is is a different entity than subblock 1 in block 2, then with the way you wrote the model:

lmer(yield ~ (1|block) + (1|subblock), data=myData )

you must code the data as per the Right table above - that is, each subblock must have a unique label.

You can avoid this problem by using the following notation:

lmer(yield ~ (1|block/subblock), data=myData )

which is the same as:

lmer(yield ~ (1|block) + (1|block:subblock), data=myData )

If you use this model formulation then both Left and Right coding should produce the same output.

This is predicated on the assumpton that you actually do have repeated measures within subblock, because this does not seem to be the case from the data shown. If the lowest unit of measurement is subblock, then you just need to fit:

lmer(yield ~ (1|block),  data=myData )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.