[R] lme versus proc mixed in SAS

From: Beatrijs Moerkerke <Beatrijs.Moerkerke_at_UGent.be>
Date: Wed 04 May 2005 - 20:03:59 EST

Dear all,

I am trying to simulate the null distribution for the likelihood ratio test statistic for testing 1 random effect versus no random effect. The asymptotic null distribution should be a mixture of a chi-squared distribution with 0 degrees of freedom and a chi-squared distribution with 1 degree of freedom. This means that I expect a point mass of 50% on 0 for the likelihood ratio test statistic. However, when I generate data using no random effects and when I calculate the test statistics for these data, I never obtain exactly zero. I think this might be due to rounding errors but in fact, 70% of the calculated test statistics are negative. I have compared a few of these results with the results in proc MIXED and I found that SAS does give test statistics that are exactly zero and gives no negative results.

The code I use for calculating the likelihood ratio test statistics is as follows:

a1<-summary(lme(y~x,random=~1|gr,method="ML"))$logLik a2<-logLik(lm(y~x))

I don't know how I can simulate the null distribution in R using lme.

Thanks for your help,

Kind regards,
Beatrijs Moerkerke

Beatrijs Moerkerke
Department of Applied Mathematics and Computer Science
Ghent University
Krijgslaan 281 - S9
B-9000 GENT
Tel: +32-(0)9-264.47.56      Fax: +32-(0)9-264.49.95
E-mail: Beatrijs.Moerkerke@UGent.be

R-help@stat.math.ethz.ch mailing list
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed May 04 22:10:22 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:35 EST