[R-sig-ME] same model runs in nlme but not lme4
Ben Bolker
bbo|ker @end|ng |rom gm@||@com
Sat May 23 00:25:05 CEST 2020
Because lme4 is fussier than lme. lme will fit models where the
variance components are jointly unidentifiable; lmer tries to detect
these problems and complains about them. It's possible that this is a
false positive. You can make it run by specifying
m1 <- lmer(y~ group*year + (year|stid), data = dat,
control=lmerControl(check.nobs.vs.nRE="ignore"))
but I strongly recommend that you think about whether this might be
exposing problems.
calculating the profile suggests a little bit of weirdness.
pp <- profile(m1,signames=FALSE)
dd <- as.data.frame(pp)
library(ggplot2)
ggplot(dd,aes(.focal,.zeta)) + geom_point() + geom_line() +
facet_wrap(~.par,scale="free_x")
You can compare confint(pp) to intervals(m2); they're mostly consistent,
but some caution is suggested for the CIs on the correlation and the year SD
On 5/22/20 5:57 PM, Simon Harmel wrote:
> Hi All,
>
> I was wondering why my model runs ok when I use `nlme` package but it fails
> when I use the `lme4` package, am I missing something?
>
> Thanks, Simon
>
> #===================================
> library(lme4)
> library(nlme)
>
> dat <- read.csv('https://raw.githubusercontent.com/hkil/m/master/z.csv')
>
> m1 <- lmer(y~ group*year + (year|stid), data = dat) ## Fails ###
>
> m2 <- lme(y~ group*year, random = ~year|stid, data = dat) ## Runs ###
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list