[R-sig-ME] Comparing variance components of crossed effects models fit with lme4 and nlme

Joshua Rosenberg jmichaelrosenberg at gmail.com
Thu Aug 10 23:05:27 CEST 2017


Hi all,

I'm trying to fit models with a) crossed random effects and b) a specific
residual structure (auto-correlation). Based on my understanding of what
nlme and lme4 do well, I would normally turn to lme4 to fit a model with
crossed random effects, but because I'm trying to structure the residuals,
I am trying nlme.

In trying to fit and compare the same variance components (no fixed
effects) model using lme4 and nlme, I found the output is similar but a bit
different. Specifically, the standard deviations of the random effects and
the log-likelihood statistics are different. Would you expect the output to
be a bit different?

The models I fit to compare the output are here, though the output is also
here:
https://bookdown.org/jmichaelrosenberg/comparing_crossed_effects_models/


library(lme4)
library(nlme)

m_lme4 <- lmer(diameter ~ 1 + (1 | plate) + (1 | sample), data = Penicillin)
m_lme4

m_nlme <- lme(diameter ~ 1, random = list(plate = ~ 1, sample = ~ 1), data
= Penicillin)
m_nlme


​Thank you for considering this question,
Josh​

-- 
Joshua Rosenberg, Ph.D. Candidate
Educational Psychology
​&​
 Educational Technology
Michigan State University
http://jmichaelrosenberg.com

	[[alternative HTML version deleted]]



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