Bill Shipley
2005-Feb-14 19:18 UTC
[R] testing equality of variances across groups in lme?
Hello. I am fitting a two-level mixed model which assumes equality of variance in the lowest-level residuals across groups. The call is: fit3<-lme(CLnNAR~CLnRGR,data=meta.analysis, + na.action="na.omit",random=~1+CLnRGR|study.code) I want to test the assumption of equality of variances across groups at the lowest level. Can someone tell me how to do this? I know that one can test a nested model in which the residuals are given weights, such as: fit3<-lme(CLnNAR~CLnRGR,data=meta.analysis, + na.action="na.omit",random=~1+CLnRGR|study.code, weights=varPower(form~CLnRGR)) This allows the residual variances to increase with the independent variable. However, I have no expectation of how the variances might change, only that they might be different across groups. Bill Shipley Subject Matter Editor, Ecology North American Editor, Annals of Botany Département de biologie, Université de Sherbrooke, Sherbrooke (Québec) J1K 2R1 CANADA Bill.Shipley@USherbrooke.ca <http://callisto.si.usherb.ca:8080/bshipley/> http://callisto.si.usherb.ca:8080/bshipley/ [[alternative HTML version deleted]]
Lorenz.Gygax@fat.admin.ch
2005-Feb-15 06:22 UTC
[R] testing equality of variances across groups in lme?
> I am fitting a two-level mixed model which assumes equality of > variance in the lowest-level residuals across groups. > The call is: > > fit3<-lme(CLnNAR~CLnRGR,data=meta.analysis, > + na.action="na.omit",random=~1+CLnRGR|study.code)I assume that CLnRGR is a factor and thus the groups which might have different variance in residuals are given by the different levels of CLnRGR!?> ... > know that one can test a nested model in which the residuals are > given weights, such as:You are on the right track here, just use: fit4<-lme(CLnNAR~CLnRGR,data=meta.analysis, na.action="na.omit", random=~CLnRGR|study.code, weights= varIdent (form= ~ 1 | CLnRGR)) with anova (fit3, fit4) you can test whether these weights improve the fits statistically. Lorenz - Lorenz Gygax, Dr. sc. nat. Centre for proper housing of ruminants and pigs Swiss Federal Veterinary Office agroscope FAT T?nikon, CH-8356 Ettenhausen / Switzerland