[R-sig-ME] Do I need random effects?

David Duffy davidD at qimr.edu.au
Fri Feb 25 05:35:37 CET 2011


On Fri, 25 Feb 2011, Murray Jorgensen wrote:

> Then I would like to do:
>
> m0 = lmer(mincr ~ icfac)
> anova(m0,m1)
>
> But lmer won't let me fit models with no random effects.

make a dummy variable eg
data(Pastes)
dummy <- rep(1,nrow(Pastes))
m1 <- lmer(strength ~ (1|batch), Pastes, REML=F)
m0 <- lmer(strength ~ (1|dummy), Pastes, REML=F)
anova(m1, m0)

-- 
| David Duffy (MBBS PhD)                                         ,-_|\
| email: davidD at qimr.edu.au  ph: INT+61+7+3362-0217 fax: -0101  /     *
| Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v




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