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

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Thu Apr 2 22:48:46 CEST 2009


Dear Ryan,

Targets needs 4 degrees of freedom because you omitted the intercept
from your model. A model with intercept needs only 3 degrees of freedom
because the intercept estimates the effect of the reference level.

HTH,

Thierry

------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium 
tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be 
www.inbo.be 

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-----Oorspronkelijk bericht-----
Van: r-sig-mixed-models-bounces at r-project.org
[mailto:r-sig-mixed-models-bounces at r-project.org] Namens Ryan Hope
Verzonden: donderdag 2 april 2009 21:52
Aan: r-sig-mixed-models at r-project.org
Onderwerp: [R-sig-ME] Wrong degrees of freedom in lmer model?

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_I
D)+(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

_______________________________________________
R-sig-mixed-models at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.




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