[R-sig-ME] Random Intercept + random slope model yields exactly the same results as random slope

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Sat Jun 14 12:59:19 CEST 2014


Dear Ulf,

Treatment is a factor. Hence the random 'slope' is a random intercept for each level of treatment. The difference between 1 + treatment and 0 + treatment (in case of a factor) is that 1 + treament uses the first level as a reference (random 'intercept'). The other levels are coded as the difference from the reference levels.

0 + treatment uses no reference level. All levels are coded as the direct effect of the level. Hence you get the same fit but with different parametrisation. Note that the variance-covariance matrix of the random effects are different.

Best regards,

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

________________________________________
Van: r-sig-mixed-models-bounces op r-project.org [r-sig-mixed-models-bounces op r-project.org] namens Ulf Mertens [mertens.ulf op gmail.com]
Verzonden: zaterdag 14 juni 2014 10:56
Aan: r-sig-mixed-models op r-project.org
Onderwerp: [R-sig-ME] Random Intercept + random slope model yields exactly the same results as random slope

Hi there,

When I run a random intercept + random slope model, I get exactly the same
result as when running a model where there is no random intercept. I can't
figure out why this is.

Model 1:

*m1 <- lmer(rt ~ treatment + (1+treatment|subject),data=df)*
*m1*
*Linear mixed model fit by REML ['lmerMod']*
*Formula: rt ~ treatment + (1 + treatment | subject)*
*   Data: df*
*REML criterion at convergence: 32558.52*
*Random effects:*
* Groups   Name        Std.Dev. Corr       *
* subject  (Intercept) 71.64               *
*          treatment2  54.55    -0.31      *
*          treatment3  54.79    -0.34  0.89*
* Residual             97.38               *
*Number of obs: 2700, groups: subject, 30*
*Fixed Effects:*
*(Intercept)   treatment2   treatment3  *
*   598.6675      -0.9037      50.9770  *

Model 2:

*m2 <- lmer(rt ~ treatment + (0+treatment|subject) ,data=df)*
*m2*
*Linear mixed model fit by REML ['lmerMod']*
*Formula: rt ~ treatment + (0 + treatment | subject)*
*   Data: df*
*REML criterion at convergence: 32558.52*
*Random effects:*
* Groups   Name       Std.Dev. Corr     *
* subject  treatment1 71.64             *
*          treatment2 75.18    0.72     *
*          treatment3 74.03    0.72 0.94*
* Residual            97.38             *
*Number of obs: 2700, groups: subject, 30*
*Fixed Effects:*
*(Intercept)   treatment2   treatment3  *
*   598.6675      -0.9037      50.9770  *

Compare both models:

*anova(m1,m2)*
*refitting model(s) with ML (instead of REML)*
*Data: df*
*Models:*
*m1: rt ~ treatment + (1 + treatment | subject)*
*m2: rt ~ treatment + (0 + treatment | subject)*
*    Df   AIC   BIC logLik deviance Chisq Chi Df Pr(>Chisq)*
*m1 10 32598 32657 -16289    32578                        *
*m2 10 32598 32657 -16289    32578     0      0          1*

Thanks in advance

        [[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