[R] Help with Bartlett's test on linear model
Stephanie Bernard
SMBernard at lbl.gov
Wed Nov 14 20:19:09 CET 2007
Hi all,
I would like to test the homoegeneity of variances between several
linear model for some analysis of covariance. It seems that the
Bartlett's test is a good test to use but I am having problem using with
linear model and I cannot find any examples on the internet. There are
some examples for comparisons of variances but not linear models.
If I take the hellung data set, which is the example in Dalgaard's book.
I know var.test works fine but I want to learn how to use the Bartlett's
test.
> hellung$glucose <- factor(hellung$glucose, labels=c("Yes","No"))
> attach(hellung)
> tethym.gluc <- hellung[glucose=="Yes",]
> tethym.nogluc <- hellung[glucose=="No",]
> lm.nogluc <- lm(log10(diameter)~log10(conc), data=tethym.nogluc)
> lm.gluc <- lm(log10(diameter)~log10(conc), data=tethym.gluc)
I guess I have two questions. 1) How to use bartlett.test with linear
model (using the model above) and 2) how to test for homogeneity of
variances of linear models when there are more than two groups.
Thanks,
Stephanie
More information about the R-help
mailing list