[R-sig-ME] How to convert the formula from LME4 to NLME?
ONKELINX, Thierry
Thierry.ONKELINX at inbo.be
Thu May 10 10:34:30 CEST 2012
Michael,
This formula is nonsens since you're fitting two random intercepts on the same grouping factor.
(fm9 <- lmer(Reaction ~ 1 + Days + (1+Days|Subject), sleepstudy, REML = FALSE)) is more sensible.
And translates to
lme(Reaction ~ 1 + Days, random = ~1+Days|Subject, sleepstudy, method = "ML")
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx op inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
-----Oorspronkelijk bericht-----
Van: r-sig-mixed-models-bounces op r-project.org [mailto:r-sig-mixed-models-bounces op r-project.org] Namens Michael
Verzonden: donderdag 10 mei 2012 0:40
Aan: Gang Chen
CC: r-sig-mixed-models op r-project.org
Onderwerp: Re: [R-sig-ME] How to convert the formula from LME4 to NLME?
Thanks a lot!
How about this one?
> (fm9 <- lmer(Reaction ~ 1 + Days + (1|Subject) + (1+Days|Subject),
+ sleepstudy, REML = 0))
On Wed, May 9, 2012 at 4:31 PM, Gang Chen <gangchen op mail.nih.gov> wrote:
> Here is my suggestion:
>
> > summary(fm9 <- lmer(Reaction ~ 1 + Days + (1|Subject) +
> (0+Days|Subject), sleepstudy, REML = 0))Linear mixed model fit by
> maximum likelihood
>
> Formula: Reaction ~ 1 + Days + (1 | Subject) + (0 + Days | Subject)
> Data: sleepstudy
> AIC BIC logLik deviance REMLdev
> 1762 1778 -876 1752 1744
> Random effects:
> Groups Name Variance Std.Dev.
> Subject (Intercept) 584.250 24.1713
> Subject Days 33.633 5.7994 <33.633%20%20%205.7994>
> Residual 653.116 25.5561
> Number of obs: 180, groups: Subject, 18
>
> Fixed effects:
> Estimate Std. Error t value
> (Intercept) 251.405 6.708 37.48
> Days 10.467 1.519 6.89
>
> Correlation of Fixed Effects:
> (Intr)
> Days -0.194
>
> > summary(fm10 <- lme(Reaction ~ 1 + Days,
> random=list(Subject=pdBlocked(list(pdIdent(~1), pdSymm(~0+Days)))),
> sleepstudy, method='ML'))
>
> Linear mixed-effects model fit by maximum likelihood
> Data: sleepstudy
> AIC BIC logLik
> 1762.003 1777.968 -876.0016
>
> Random effects:
> Composite Structure: Blocked
>
> Block 1: (Intercept)
> Formula: ~1 | Subject
> (Intercept)
> StdDev: 24.17127
>
> Block 2: Days
> Formula: ~0 + Days | Subject
> Days Residual
> StdDev: 5.799409 25.55613
>
> Fixed effects: Reaction ~ 1 + Days
> Value Std.Error DF t-value p-value
> (Intercept) 251.40510 6.745252 161 37.27142 0
> Days 10.46729 1.527826 161 6.85110 0
> Correlation:
> (Intr)
> Days -0.194
>
> Standardized Within-Group Residuals:
> Min Q1 Med Q3 Max
> -3.9535402 -0.4672676 0.0239343 0.4625157 5.1883448
>
> Number of Observations: 180
> Number of Groups: 18
>
>
> On Wed, May 9, 2012 at 5:01 PM, Michael <comtech.usa op gmail.com> wrote:
> > How to convert the formula from LME4 to NLME?
> >
> > Hi all,
> >
> > We have the following fomular in LME4:
> >
> > > (fm9 <- lmer(Reaction ~ 1 + Days + (1|Subject) +
> > (0+Days|Subject),
> > + sleepstudy, REML = 0))
> >
> > How to do the same in NLME?
> >
> > Thanks a lot!
> >
> > [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-mixed-models op r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
[[alternative HTML version deleted]]
_______________________________________________
R-sig-mixed-models op r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.
More information about the R-sig-mixed-models
mailing list