[R] F tests for random effect models
Jacques VESLOT
jacques.veslot at cirad.fr
Thu Oct 27 08:22:23 CEST 2005
Dear R-users,
My question is how to get right F tests for random effects in random effect models (I hope this
question has not been answered too many times yet - I didn't find an answer in rhelp archives).
My data are in mca2 (enc.) :
names(mca2)
[1] "Lignee" "Pollinisateur" "Rendement"
dim(mca2)
[1] 100 3
replications(Rendement ~ Lignee * Pollinisateur, data = mca2)
Lignee Pollinisateur Lignee:Pollinisateur
20 10 2
Of course, summary(aov(Rendement ~ Pollinisateur * Lignee, data = mca2)) gives wrong tests of random
effects. But, summary(aov1 <- aov(Rendement ~ Error(Pollinisateur * Lignee), data = mca2)) gives no
test at all, and I have to do it like this :
tab1 <- matrix(unlist(summary(aov1)), nc=5, byrow=T)[,1:3]
Femp <- c(tab1[1:3, 3]/tab1[c(3,3,4), 3])
names(Femp) <- c("Pollinisateur", "Lignee", "Interaction")
1 - pf(Femp, tab1[1:3,1], tab1[c(3,3,4),1])
With "lme4" package (I did'nt succeed in writing a working formula with lme from "nlme" package), I
can "see" standard deviations of random effects (but don't know how to find them) with :
library(lme4)
summary(lmer(Rendement ~ (1 |Pollinisateur) + (1 | Lignee) + (1 | Pollinisateur:Lignee), data=mca2))
but I can't get F tests.
Thanks in advance.
Best regards,
Jacques VESLOT
More information about the R-help
mailing list