Search code examples
rregressionlme4mixed-modelsnlme

The sommer package equivalent of lmer(Reaction ~ Days + (Days | Subject), data = sleepstudy)


In lme4, lmer(Reaction ~ Days + (Days | Subject), data = sleepstudy) specifies a linear mixed model with random intercept by Subject and random slope of Days, with correlated random intercept and random slope.

In sommer package, mmer(Reaction ~ Days, random= ~ Subject + vsr(Days, Subject), data = sleepstudy), tolParInv = 1e-6, verbose = FALSE) only returns uncorrelated random intercept and random slope terms, which corresponds to lmer(Reaction ~ Days + (0 | Subject) + (0 + Days | Subject), data = sleepstudy).

For lmer(Reaction ~ Days + (Days | Subject), data = sleepstudy), is it possible to specify an exact equivalence in sommer package?


Solution

  • The documentation on CRAN indicates that there is no equivalent. The one you posted is the closest.

    https://cran.r-project.org/web/packages/sommer/vignettes/v5.sommer.vs.lme4.pdf