Message-ID: <351D3C0A50D2FF47B31C2ADBD015A50D01BA1440@EXCHANGEVS1.uthsc.tennessee.edu>
Date: 2007-09-06T15:58:02Z
From: Bush, Andrew J
Subject: lmer vs lmer2
In-Reply-To: <40e66e0b0709051922jda8f867i490b304c14e6a8df@mail.gmail.com>
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.
Andy
-----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.