I've been putting a lot of work over the last few days into bring mixed effects models to bear on some behavioural data I've collected for my thesis, but it's occurred to me that I'm not 100% sure that this kind of model is actually appropriate for my data (I only came across them after starting the experiment).
In an experiment, 60 participants
completed 28 trials
of a reasoning task, consisting of 14 problems
(call them "A"-"N"), with participants completing each in 2 conditions
, x
(conflict) and y
(control).
Participant Problem
1 Ax/Ay Bx/By Cx/Cy Dx/Dy ... Nx/Ny
2 Ax/Ay Bx/By Cx/Cy Dx/Dy ... Nx/Ny
3 Ax/Ay Bx/By Cx/Cy Dx/Dy ... Nx/Ny
4 Ax/Ay Bx/By Cx/Cy Dx/Dy ... Nx/Ny
5 Ax/Ay Bx/By Cx/Cy Dx/Dy ... Nx/Ny
... ... ... ... ... ... ...
60 Ax/Ay Bx/By Cx/Cy Dx/Dy ... Nx/Ny
I'm interested in the difference in a trial-by-trial variable (let's call it reaction time
) between the conflict and control conditions, and would expect it to be higher for the conflict (y
) trials.
Obviously, I would expect to find a within-subject correlation - some subjects are generally fast, some generally slow. I would also expect to find a within-problem correlation - some problems are answered faster than others, regardless of condition. To account for these, I include random intercepts for these two factors:
(1|participant) + (1|problem)
.
The difference between conflict and control conditions may or may not turn out to be the same for each subject, and for each problem. For this reason, I consider including random slopes as well:
(1 + condition|participant) + (1 + condition|problem)
.
Putting this together, I'm testing a model that looks either like:
null_model = lmer(reaction_time ~ condition(1|participant) + (1|problem), data=data)
condition_model = lmer(reaction_time ~ condition + (1|participant) + (1|problem), data=data)
or
null_model = lmer(reaction_time ~ (1 + condition|participant) + (1 + condition|problem), data=data)
condition_model = lmer(reaction_time ~ condition(1|participant) + (1|problem), data=data)
.
Please; have I horribly misunderstood how this is supposed to work?
Edit: The more traditional approach to analysing this data would be to average across problems within each participant, yielding two data points per participant: conflict condition mean
and control condition mean
, and then use a paired-samples t test. Reading this question, I thought that this approach should be largely the same as fitting
lmer(reaction_time ~ condition + (1|participant), data=data)
,
but trying this in R, it seems otherwise.
Edit #2: Bounty added.