[R] Linear model vs Mixed model

Thierry Onkelinx
Tue, 12 Jul 2016 13:45:39 -0000

The parametrisation is different.

The intercept in model 1 is the effect of the "average" subject at
days =0.
The intercept in model 2 is the effect of the first subject at days == 0.

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

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

2016-07-12 15:35 GMT+02:00 Utkarsh Singhal <utkarsh.iit at gmail.com>:

> Hi experts,
>
> While the slope is coming out to be identical in the two methods below, the
> intercepts are not. As far as I understand, both are formulations are
> identical in the sense that these are asking for a slope corresponding to
> 'Days' and a separate intercept term for each Subject.
>
> # Model-1
> library(lmer)
> coef(lmer(Reaction ~ Days + (1| Subject), sleepstudy))
>
> # Model-2
> coef(lm(Reaction ~ Days + Subject, sleepstudy))
>
> Can somebody tell me the reason? Are the above formulations actually
> different or is it due to different optimization method used?
>
> Thank you.
>
> Utkarsh Singhal
> 91.96508.54333
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>