[R-sig-ME] Wrong degrees of freedom in lmer model?

Ryan Hope rmh3093 at gmail.com
Thu Apr 2 21:51:49 CEST 2009


I am trying to use the lmer function to analyze the data from the
thesis experiment. The response variable is a continuous variable,
completion time. I have 2 fixed factors, number of targets (4-levels:
4,9,14,19) and displacement per second (DPS) (3-levels: 72.42, 84.99,
88.99). I also have 3 random variables, participants, block (which
group the replicates of a combination of fixed factors), and target
displacement. The R code that I am using is listed below:

library(lme4)
datafile="http://people.rit.edu/rmh3093/master1.csv"
master1=read.table(datafile,header=T)
master1$Targets=as.factor(master1$Targets)
model=lmer(log(Completion_Time)~-1+Targets+DPS+(-1+Targets|Participant_ID)+(1|Block)+(1|Target_Displacement),data=master1)
anova(model)

Im not even sure if the lmer model I am using is 100% correct but it
seems the best to based on what I've read on
(http://www.let.uu.nl/~Hugo.Quene/personal/multilevel/jml2008/x24lmerlog.html).
Anyway, I do not understand the degrees of freedom reported by the
anova function based on my model (shown below):

Analysis of Variance Table
        Df Sum Sq Mean Sq    F value
Targets  4  33393    8348 39411.3500
DPS      1      2       2     7.7816

Since there are 4 levels of the Target factor, shouldn't the Df for
Targets be 3 not 4?

-Ryan




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