Skip to content
Back to formatted view

Raw Message

Message-ID: <77d17263-8f4a-224f-414a-e2ad60030144@gmail.com>
Date: 2020-05-22T22:25:05Z
From: Ben Bolker
Subject: same model runs in nlme but not lme4
In-Reply-To: <CACgv6yVmFT3fQ9CS7vh0KmXZKJ_retymaGut+7C2qPEjy5bJew@mail.gmail.com>

? 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 at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models