Assume that you repeatedly collected measures from multiple subjects under different conditions, e.g. reaction times in response to differently colored stimuli:

| Subject | Condition | RT    |
|    1    | Red       | 323   |
|    1    | Red       | 243   |
|    1    | Blue      | 665   |
|    1    | Blue      | 242   |
|    2    | Red       | 163   |
|    2    | Red       | 344   |
|    2    | Blue      | 233   |
|    2    | Blue      | 119   |
|   ....  | ....      | ...   |

Now, to compare reaction times between conditions, you could easily calculate a paired t-test (i.e. a one-sample t-test over the differences). You could also apply a random-intercept linear mixed model over the aggregated (averaged per condition and subject) data and receive the same - mathematically equivalent - result:

lmer(RT ~ Condition + (1|Subject))

Question: However, you could also run the above model without aggregating fist. This obviously yields a different result. Would this model still be interpretable? How would it be different from the aggregated data?


Apologies in advance, but I don't understand why you would aggregate in the first place to run a linear mixed model. As I understand it, you have repeated trials in which each subject is exposed to multiple trials per condition. If that is true, then the random intercept is designed to deal with this type of data. You add in a predictor for condition and this will be the mean difference in reaction time for each of three conditions that are not coded 0 in your condition factor variable. The code is exactly the same as you have presented:

m1 <- lmer(RT ~ 1 + condition + (1|Subject), data=df) 

This model appropriately accounts for the correlation of reaction times within individuals (random intercept) and provides a test of the mean difference between the referent condition and each of the other conditions. You can use emmeans or effects to get the pairwise comparisons:

emmeans(m1, list(pairwise ~ condition), adjust = "holm") #can use different adjustment
| cite | improve this answer | |
  • $\begingroup$ Thank you, It's just that averaging is a common practice in many fields (e.g. EEG amplitudes). Is there any benefit in doing this? $\endgroup$ – ratatosk Apr 17 at 17:14
  • $\begingroup$ I don't see any benefit of doing so here, @ratatosk. You want to feed these types of models more data (more repeated observations) rather than less so that it has better information on the within-subject correlation. $\endgroup$ – Erik Ruzek Apr 17 at 19:56

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.