[R-sig-ME] Interpreting Mixed Effects Model on Fully Within-Subjects Design

Dave Deriso deriso at gmail.com
Thu May 20 20:13:35 CEST 2010


Dear Mixed Models Experts,

I am trying to find the p_value for the overall interaction of
condition*difficulty, but the lme() seems to output everything but
this. Can offer some suggestions on how to make sense of this output,
and where my interaction and main effects are? I read the 'mixed
effects' section in the R Book (Crawley, 2007) and still can't figure
it out. Any advice will be very much appreciated.

lme(value~condition*diff,random=~1|subject/rep)

Fixed effects: value ~ condition * diff
                      Value Std.Error  DF   t-value p-value
(Intercept)       300109.95  9506.690 688 31.568289  0.0000
condition2         27717.65  9071.048 688  3.055617  0.0023
condition3        -23718.72  9071.048 688 -2.614772  0.0091
diff50             56767.55  9071.048 688  6.258103  0.0000
diff75            120031.80  9071.048 688 13.232408  0.0000
condition2:diff50 -45481.21 12828.399 688 -3.545354  0.0004
condition3:diff50   7333.37 12828.399 688  0.571651  0.5677
condition2:diff75 -38765.77 12828.399 688 -3.021871  0.0026
condition3:diff75  12919.59 12828.399 688  1.007109  0.3142


Here is a synopsis:

There are 5 independent variables (subject, condition, difficulty,
repetition) and 1 dependent measure (value). Condition and difficulty
are fixed effects and have 3 levels each (1,2,3 and 25,50,75
respectively), while subject and repetition are random effects. Three
repeated measurements (rep = 1,2,3) were taken for each condition x
difficulty pair for each subject, making this an entirely
within-subject design.

Here is the code:

#get the data
study.data =read.csv("http://files.davidderiso.com/example_data.csv", header=T)
attach(study.data)
subject = factor(subject)
condition = factor(condition)
diff = factor(diff)
rep = factor(rep)

#visualize whats happening
interaction.plot(diff, condition, value, ylim=c(240000,
450000),ylab="value", xlab="difficulty", trace.label="condition")

#compute the significance
library(nlme)
study.lme = lme(value~condition*diff,random=~1|subject/rep)
summary(study.lme)

Best,
Dave Deriso
UCSD Psychology




More information about the R-sig-mixed-models mailing list