Skip to content
Prev 16542 / 20628 Next

R-sig-mixed-models Digest, Vol 136, Issue 41

Sorry, I forgot that lmer() (unlike lmer_alt() from the afex package)
does not convert factors to numeric covariates when using the the
double-bar notation!
The model I was talking about would be:

m_zcp5 <- lmer_alt(angle ~ recipe  + (recipe || replicate), cake)
VarCorr(m_zcp5)
 Groups      Name        Std.Dev.
 replicate   (Intercept) 6.2359
 replicate.1 re1.recipe1 1.7034
 replicate.2 re1.recipe2 0.0000
 Residual                5.3775

This model seems to differ (and I don't really understand why) from
m_zcp6 which I think is equivalent to your m_zcp4:
m_zcp6 <- lmer_alt(angle ~ recipe  + (0 + recipe || replicate), cake)
VarCorr(m_zcp6)
 Groups      Name        Std.Dev.
 replicate   re1.recipeA 5.0429
 replicate.1 re1.recipeB 6.6476
 replicate.2 re1.recipeC 7.1727
 Residual                5.4181

anova(m_zcp6, m_zcp5, refit = FALSE)
Data: data
Models:
m_zcp6: angle ~ recipe + ((0 + re1.recipeA | replicate) + (0 + re1.recipeB |
m_zcp6:     replicate) + (0 + re1.recipeC | replicate))
m_zcp5: angle ~ recipe + ((1 | replicate) + (0 + re1.recipe1 | replicate) +
m_zcp5:     (0 + re1.recipe2 | replicate))
       Df    AIC    BIC  logLik deviance  Chisq Chi Df Pr(>Chisq)
m_zcp6  7 1781.8 1807.0 -883.88   1767.8
m_zcp5  7 1742.0 1767.2 -863.98   1728.0 39.807      0  < 2.2e-16 ***

Do m_zcp5 and Model3b estimate the same random effects in this case?
If not, what is the difference between m_zcp5 and Model3b (except for
the fact that the variance depends on the
recipe in m_zcp5) and which one is the more complex model?
I would be glad if you could elaborate on this and help me and the
others understand these models.

Cheers,
Maarten
On Tue, May 1, 2018 at 9:53 PM, Rune Haubo <rune.haubo at gmail.com> wrote: