Dear Prof. Bates,

this is really helpful. I could not understand how a model with strong 
correlation of the random effects could not be better than a model that 
does not take this correlation into account. I also plot the 95% 
prediction intervals on the random effects using 
dotplot(m2,postVar=TRUE) and most of them fall away from zero.


m1<-lmer(pc1 ~ year + datejc + stage + rept + age + tarsusc + mtempc +
windsc + rhc + (1|id)+(0+mtempc|id, data=ndf, REML=0)

m2<-lmer(pc1 ~ year + datejc + stage + rept + age + tarsusc + mtempc +
windsc + rhc + (1+mtempc|id), data=ndf, REML=0)


Indeed, when I compare this two models with LRT test I have a very small 
p-value. I believe I can be confident that the test adequately reflects 
the differences between the  models.

Thanks,

Gustavo




On 10-08-04 8:05 AM, Douglas Bates wrote:
> On Wed, Aug 4, 2010 at 2:23 AM, David Duffy<davidD@qimr.edu.au>  wrote:
>    
>> On Tue, 3 Aug 2010, Gustavo Betini wrote:
>>
>>      
>>> m1<-lmer(pc1 ~ year + datejc + stage + rept + age + tarsusc + mtempc +
>>> windsc + rhc + (1|id), data=ndf, REML=0)
>>> m2<-lmer(pc1 ~ year + datejc + stage + rept + age + tarsusc + mtempc +
>>> windsc + rhc + (1+mtempc|id), data=ndf, REML=0)
>>>
>>> In order to compare these two models I would use a LRT test:
>>>
>>> anova(m1,m2)
>>>
>>> However, LRT test is not recommended when Corr is near the extremes
>>> (+1,-1). So, how I compare the fit of two models in lme4 when the
>>> correlation between two random effects are near the extremes?
>>>
>>>        
>> You can always look at the likelihood ratio, the question is whether it
>> follows a simple chi-square distribution under the null or not.
>> If the LR is large enough, then it probably won't matter anyway. You can
>> obtain percentiles by an appropriate simulation based on your data setup,
>> especially since m1 only has id as a random effect.  I don't think the
>> RLRsim package can be used here, but its author may clarify on that.
>>      
> I agree with David that you can always look at the likelihood ratio
> and if its value is very large then whether or not the chi-square
> approximation to the change in the deviance is accurate you will still
> have strong evidence that the random effects correlation is
> non-negligible.
>
> However, I think you are comparing the wrong models.  You should
> compare m2 to the same model but with random effects of the form
>
> (1|id) + (0+mtempc|id)
>
> if you want to isolate the correlation parameter.
>    

	[[alternative HTML version deleted]]


