My goal is to test whether reaction is significantly different between tasks (a, b, and c). However, the order in which I run the tasks in my experiment may affect the reaction. But I'm not interest in the specific levels of the factor Order, so I decided not to account for that as a fixed effect. Each subject had a different order.

Currently here is what I thought would be appropriate for that:

Reaction ~ Task + (1+order|Subject). But I'm not sure if that is the best way to represent it. Do I account for he order as a random slope, as I have done, or as intercept: Reaction ~ Task + (1|Subject) + (1|Order) or perhaps should Order be nested: Reaction ~ Task + (1|Subject/Order)?


1 Answer 1


Reaction ~ Task + (1 + Order|Subject) says the effect of order varies by subject but on average is exactly equal to zero. That is certainly not what you intend to assume.

Reaction ~ Task + (1|Subject) + (1|Order) says each order has its own intercept (which is added to the subject intercept), and that the order-intercepts have a normal distribution (or that you want to penalize their variance to use information from other orders). This seems like a plausible interpretation of your assumptions.

Reaction ~ Task + (1|Subject/Order) says each subject-order combination has its own intercept, but since each subject only sees one order, this is the same as just having Reaction ~ Task + (1|Subject) and ignoring order.

To me, the second specification seems closest to what you want, though there are only 6 orders, so there doesn't seem to be that good a reason for including it as a random effect vs. a fixed effect. That is, Reaction ~ Task + Order + (1|Subject) should be an adequate model. Just because you are not interested in each order's effect doesn't mean you shouldn't include it as a fixed effect; we never care about the effects of confounders on our outcome in an observational study but they still need to be adjusted for, e.g., by including them in the model. You can just ignore the Order coefficients in your output and focus your interpretation on the Task effects.

  • $\begingroup$ If you can ignore the Order coefficients depends on the contrasts. With the default treatment contrasts you can't ignore them. $\endgroup$
    – Roland
    Feb 29 at 7:17

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.