0
$\begingroup$

Can you please explain where is the difference between the following two models :

fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
fm2 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy)

I noticed there is some discrepency in the estimate for random effect between model fm1 and fm2 . But don't know why ?

summary(fm1)$varcor
Groups   Name        Std.Dev. Corr 
Subject  (Intercept) 24.7404       
          Days         5.9221  0.066
Residual             25.5918       


summary(fm2)$varcor
Groups    Name        Std.Dev.
Subject   (Intercept) 25.0513 
Subject.1 Days         5.9882 
Residual              25.5653 

And the fixed effect estimates are same for the both model .

| cite | improve this question | | | | |
$\endgroup$
3
$\begingroup$

The second model includes random intercepts and slopes, under the assumption that the correlation between them is 0. The first model also estimates that correlation and thus has one more parameter.

| cite | improve this answer | | | | |
$\endgroup$
  • 1
    $\begingroup$ +1 -- but don't you mean to say one more parameter and therefore one less degree of freedom? $\endgroup$ – whuber Jul 27 '15 at 16:59
  • $\begingroup$ @Pavel But I see both have same number of parameter , in first model (Intercept) and Days also , in the second model (Intercept) and Subject.1 Days , though I don't understand what is meant by Subject.1 ? $\endgroup$ – user81411 Jul 28 '15 at 11:25
  • $\begingroup$ And how is to see the degrees of freedom? $\endgroup$ – user81411 Jul 28 '15 at 11:26
  • $\begingroup$ @Munira: But there is an additional parameter in the first model which is the correlation. It's in the right-most column (0.066, in your example). "Subject.1" is just a minor technicallity - it's R's way of dealing with two rows with the same name. $\endgroup$ – Pavel Jul 30 '15 at 9:26
  • $\begingroup$ @Munira: Degrees of freedom appear to be a problematic issue when you model random effects: stat.ethz.ch/pipermail/r-help/2006-May/094765.html $\endgroup$ – Pavel Jul 30 '15 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.