[R-sig-ME] lme repeated measures model statement
Matt Meier
memeier at uncg.edu
Fri Feb 4 20:44:39 CET 2011
Hello,
I'm transitioning from repeated measures ANOVAs to mixed effects and
could use some help. I want to describe how people who differ in a
cognitive ability (wmcz) differ in the performance of an experimental
task. Currently, I'm interested in response times as the dependent
measure. This project is a totally within-subjects repeated measures
design. The following is what the dataframe looks like:
id trialtype con rrt wmcz
201 7000 stroop 1 0.002150538 0.6408047
202 7000 stroop 0 0.002114165 0.6408047
207 7000 simon 0 0.002475248 0.6408047
210 7000 simon 0 0.002739726 0.6408047
211 7000 stroop 1 0.002283105 0.6408047
213 7000 simon 1 0.002277904 0.6408047
214 7000 simon 0 0.003125000 0.6408047
215 7000 simon 0 0.002777778 0.6408047
216 7000 simon 1 0.002309469 0.6408047
217 7000 stroop 0 0.002114165 0.6408047
id - is the subject number
trialtype - is a discrete predictor with 2 levels
con(congruency) - is a discrete predictor with 2 levels
rrt(reciprocal of response time)- is the outcome variable
wmcz- is a subject variable that is a continuous predictor
.frame': 66463 obs. of 5 variables:
$ id : int 7000 7000 7000 7000 7000 7000 7000 7000 7000 7000 ...
$ trialtype: Factor w/ 2 levels "simon","stroop": 2 2 1 1 2 1 1 1 1 2 ...
$ con : Factor w/ 2 levels "0","1": 2 1 1 1 2 2 1 1 2 1 ...
$ rrt : num 0.00215 0.00211 0.00248 0.00274 0.00228 ...
$ wmcz : num 0.641 0.641 0.641 0.641 0.641 ...
There are 228 subjects with about 300 observation per subject. 50% of
the trials are of the trialtype stroop and 50% are congruent(con = 0).
I'm interested in the interaction between wmcz, con, and trialtype on
rrt. I think wmcz will interact with stroop trialtype crossed with
congruency but not with simon trialtype crossed with congruency. I
plan on comparing a model with both interaction effects to a model
with only the stroop*con*wmcz interaction.
I would describe the design as trialtype crossed with congruency
nested within subjects. Also nested within the subjects is wmcz. I've
been taught that ideally wmcz should be treated as a random effect
because I want to generalize the results to wmcz values not in my
sample, but I if I did this I don't think I would be able to model the
interaction between wmcz, trialtype, and congruency. Am I right about
this? If not, an example of how to do this would be greatly
appreciated.
Below is one of my first cracks at a model statement:
lme(rrt ~ trialtype*con*wmcz, data = , random = ~ 1|id/wmcz/trialtype/con)
lme(rrt ~ trialtype*con*wmcz, data = , random = ~ 1|id/wmcz)
Is one of these models right for this design? Why? Or why not?
Thanks,
Matt
More information about the R-sig-mixed-models
mailing list