Suppose I have the following nested lmer structure:

lmer(Y ~ X1 + X2 + X1:X2 + (1 | A) + (1 | A:B), data=d)

which is the same as:

lmer(Y ~ X1 * X2 + (1 | A/B), data=d)

Now if I would write it out in a report, I'd say something like:

Y modelled by X1 and X2 including the interaction of X1 and X2 (as the fixed effects) and B nested in A (as the random effects).

Both + (1 | A/B) and + (1 | A) + (1 | A:B) symbolize nesting and are equivalent. But how about when I don't want the effect of A to be estimated:

lmer(Y ~ X1 + X2 + X1:X2 + (1 | A:B), data=d)

Can I still simply say:

1. B nested in A (even though the random effect for A is now omitted?)

Or should it be:

2. B nested in A without the effect of A

Or since the : in the fixed effects part denotes for an interaction, could I potentially say:

3. The random effects part of the model was given as the interaction of A and B.

  • 2
    $\begingroup$ "with a random intercept for every observed combination of A and B"? $\endgroup$ – conjugateprior Feb 22 '16 at 21:44
  • $\begingroup$ @conjugateprior that's sounds perfect and is exactly what it is! Thanks! What do you think about naming it an "interaction"? $\endgroup$ – Stefan Feb 23 '16 at 1:22
  • $\begingroup$ I think that'd be slightly confusing actually. You're just using R's interaction syntax to redefine a grouping variable, in a slightly more agnostic / less structured way than in previous specifications. fwiw the last time I did this was with countries and government ministries (also nested), so I referred to the country:ministry group as a 'work context'. $\endgroup$ – conjugateprior Feb 23 '16 at 14:32
  • $\begingroup$ Thanks, that makes sense @conjugateprior . If you want to summarize your comments to an answer, I'd accept it. $\endgroup$ – Stefan Feb 23 '16 at 14:40

I would describe the final model as simply having

a random intercept for every observed combination of A and B.

Although it looks like an interaction because you're just using R's interaction syntax, you're really just redefine a grouping variable in a slightly less structured way than in the previous specifications, ensuring that the random effect can now vary more freely than in the previous arrangements.

For expository purposes you may wish to give 'every observed combination of A and B' a name that makes sense to readers in terms of the study you are analyzing.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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