[R] testing equality of variances across groups in lme?

Lorenz.Gygax@fat.admin.ch Lorenz.Gygax at fat.admin.ch
Tue Feb 15 07:22:53 CET 2005


> 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




More information about the R-help mailing list