[R-sig-ME] How do I model a factorial repeated measures experiment with replicates?
Ryan Hope
rmh3093 at gmail.com
Sun Apr 5 20:49:22 CEST 2009
I've been trying to use the lmer() function to model my experiment by
following the examples in "The R Book" and some other papers
pertaining to mixed-effects models with crossed random effects. Since
I have never done an analysis like this before (and neither have my
professors) I have no confidence in the results that I come up with.
In fact, I am not even sure that my model correctly represents the
design of my experiment...
My experiment is a 4x3 fully factorial within-subjects design with
replicates (12 blocks with 5 trials in each block). My data is in the
standard "long" format and with 31 participants I have 1860 rows of
data. The data file for those who are interested is here:
http://people.rit.edu/rmh3093/master1.csv
Fixed Factors:
Targets 4-Levels (4,9,14,19)
Entropy 3-Levels (Low, Medium, High)
Random:
Participant_ID - Unique ID for participant
Trial_Order - The order in which each trial was performed (to see if
the participant got better or worse with time)
Replicate - Essentially reflects a time variable, each participant did
5 trials for a particular block of factor combinations. They did each
replicate one after another completing the block before going on to
the next block.
Block - A categorical indicator of the factor combination (another way
to group replicates basically)
Probably the most important note was that each trial was generated
randomly, no 2 trials were exactly the same.
The first part of the formula is for the most part obvious (I am not
worried about the interaction between the main factors) but I am not
sure if I am supposed to say anything about the intercept. Some
examples I see include it; others dont:
Completion_Time~(Targets+Entropy)
Completion_Time~(1+Targets+Entropy)
Completion_Time~(-1+Targets+Entropy)
And I definitely don't understand is the random effects part. How do I
tell the model that each participant performed each factor combination
5 times? I've tried the following for the random section:
((Targets+Entropy)|Participant_ID)
((Targets+Entropy)|Participant_ID)+(1|Replicate)
(1+(Targets+Entropy)|Participant_ID)+(1|Replicate)
(-1+(Targets+Entropy)|Participant_ID)+(1|Replicate)
(Targets|Participant_ID)+(Entropy|Participant_ID)
(Targets|Participant_ID)+(Entropy|Participant_ID)+(1|Replicate)
(1+Targets|Participant_ID)+(Entropy|Participant_ID)+(1|Replicate)
(-1+Targets|Participant_ID)+(Entropy|Participant_ID)+(1|Replicate)
(Targets/Replicate|Participant_ID)+(Entropy/Replicate|Participant_ID)
(Targets|Participant_ID/Replicate)+(Entropy|Participant_ID/Replicate)
(-1+Targets/Replicate|Participant_ID)+(-1+Entropy/Replicate|Participant_ID)
etc...
I am so lost here! I don't know which one, if any of the above are
correct. Any suggestions would be greatly appreciated!!
Thanks for your time!
-Ryan
More information about the R-sig-mixed-models
mailing list