[R-sig-ME] lmer vs lmer2
Henric Nilsson (Private)
nilsson.henric at gmail.com
Thu Sep 13 09:51:17 CEST 2007
Quoting Martin Maechler <maechler at stat.math.ethz.ch>:
>>>>>> "DB" == Douglas Bates <bates at stat.wisc.edu>
>>>>>> on Thu, 6 Sep 2007 11:17:17 -0500 writes:
>
> DB> On 9/6/07, Bush, Andrew J <abush at utmem.edu> wrote:
> >> Dear Douglas,
>
> >> In frustration, I invoked lmer2 this morning and I'm pleased
> to be able
> >> to tell you that lmer2 copes well and quickly with the model having a
> >> random intercept and two random covariate slopes. I have not
> been able
> >> to get lmer to converge for the model on the same data.
>
> DB> Thanks for the information.
>
> DB> I expect to remove the confusion between lmer and lmer2 in the near
> DB> future. The development version of the lme4 package has an lmer
> DB> function that is close to the current lmer2 in design. It should
> DB> exhibit the same convergence behavior and be slightly faster
> on models
> DB> fit to large data sets than is the current lmer2.
>
> DB> This version has been in development for longer than I had expected.
> DB> I still have a few "infelicities" to resolve in the Laplace
> method for
> DB> generalized linear mixed models before I make test versions
> available.
>
> DB> I would be interested in the data set if you would be willing to
> DB> provide it. I could perhaps incorporate it in the lme4 package so
> DB> others would have access to it.
>
> Yes, indeed.
> The example might be particularly interesting as test case, not
> only because some software implementations "converge" with
> singular covariance matrix, but also because it
> differs from other examples in having "many" fixed effects and
> just one level random effects.
The data set in question, and, I belive, most others from Fitzmaurice,
Laird and Ware's (2004) book on longitudinal data analysis, is
available along with accompanying SAS programs at
http://biosun1.harvard.edu/~fitzmaur/ala/
In particular, the data used above is here
http://biosun1.harvard.edu/~fitzmaur/ala/fev1.txt
and the SAS code is here
http://biosun1.harvard.edu/~fitzmaur/ala/prog8_8.html
HTH,
Henric
>
> Martin
>
> >> -----Original Message-----
> >> From: dmbates at gmail.com [mailto:dmbates at gmail.com] On Behalf
> Of Douglas
> >> Bates
> >> Sent: Wednesday, September 05, 2007 9:22 PM
> >> To: ajbush at bellsouth.net
> >> Cc: r-sig-mixed-models at r-project.org
> >> Subject: Re: [R-sig-ME] Specifying random effects for multiple
> >> covariates via lmer
> >>
> >> On 9/5/07, Andy Bush <ajbush at bellsouth.net> wrote:
> >> > While working through the text "Applied Longitudinal Analysis" by
> >> > Fitzmaurice, Laird and Ware, I encountered a fairly simple
> case study
> >> (pp
> >> > 210-7) in which a longitudinal model specifies three random effects:
> >> (1)
> >> > random intercepts for id, (2) random slopes for covariate1
> (Age | id),
> >> and
> >> > (3) random slopes for covariate2 (log(ht) | id). I've had no
> >> difficulty
> >> > formulating lmer models with correlated random intercepts and slopes
> >> for
> >> > either of the covariates individually but have not succeeded when I
> >> try to
> >> > compose a model with correlated random intercepts and slopes for two
> >> > covariates.
> >>
> >> > Following is code that works well with the individual covariates
> >> separately:
> >>
> >> > m1=lmer(LFEV1~Age + loght + InitAge + logbht + (1 + Age |
> >> id),data=fev,
> >> > na.action=na.omit, method="REML")
> >>
> >> > m2=lmer(LFEV1~Age + loght + InitAge + logbht+(1 + loght |
> >> id),data=fev,
> >> > na.action=na.omit, method="REML")
> >>
> >> Maybe I am missing the point but wouldn't the model you are
> >> considering be written as
> >>
> >> lmer(LFEV1 ~ Age + loght + InitAge + logbht + (loght + Age|id), data =
> >> fev, na.action = na.omit, method = "REML")
> >>
> >> That provides correlated random effects for the intercept, the
> >> coefficient for loght and the coefficient for Age at each level of the
> >> id factor.
> >>
>
> DB> _______________________________________________
> DB> R-sig-mixed-models at r-project.org mailing list
> DB> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
> _______________________________________________
> R-sig-mixed-models at 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