Brian Ripley once posted a function for Levene's test to the R-help list. I incorporated a slightly modified version in the Rcmdr package. Since the function is very simple, I'll just list it here (it doesn't make sense to use the Rcmdr package just for this function):
levene.test <- function(y, group) {
meds <- tapply(y, group, median, na.rm=TRUE)
resp <- abs(y - meds[group])
table <- anova(lm(resp ~ group))
rownames(table)[2] <- " "
cat("Levene's Test for Homogeneity of Variance\n\n")
table[,c(1,4,5)]
}By the way, "group" is a factor.
John
At 10:39 AM 8/13/2003 -0400, Haynes, Maurice (NIH/NICHD) wrote:
Has the Levene test of homogeneity of variance been implemented in any library in R?
Thanks,
Maurice Haynes
----------------------------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: [EMAIL PROTECTED] phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
