Haynes, Maurice (NIH/NICHD)
2003-Aug-13 14:39 UTC
[R] Levene test of homogeneity of variance
Has the Levene test of homogeneity of variance been implemented in any library in R? Thanks, Maurice Haynes National Institute of Child Health and Human Development Child and Family Research Section 6705 Rockledge Drive Bethesda, MD 20892 Voice: 301-496-8180 Fax: 301-496-2766 E-Mail: mh192j at nih.gov
Haynes, Maurice (NIH/NICHD) wrote:> Has the Levene test of homogeneity of variance been implemented in any > library in R?levene.test() is in "Rcmdr". Uwe Ligges> Thanks, > > Maurice Haynes > National Institute of Child Health and Human Development > Child and Family Research Section > 6705 Rockledge Drive > Bethesda, MD 20892 > Voice: 301-496-8180 > Fax: 301-496-2766 > E-Mail: mh192j at nih.gov > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
On Wed, 2003-08-13 at 09:39, Haynes, Maurice (NIH/NICHD) wrote:> Has the Levene test of homogeneity of variance been implemented in any > library in R? > > Thanks, > > Maurice Haynes > National Institute of Child Health and Human Development > Child and Family Research Section > 6705 Rockledge Drive > Bethesda, MD 20892 > Voice: 301-496-8180 > Fax: 301-496-2766 > E-Mail: mh192j at nih.gov>From a search on the r-help archives and CRAN it would appear there is alevene.test() function in John Fox's RCmdr package, which is based upon an exchange back in 2000 here: http://maths.newcastle.edu.au/~rking/R/help/00b/0663.html You may wish to review the entire thread for additional comments and I would defer to John and the original thread participants for any updated commentary. HTH, Marc Schwartz
Dear Maurice, 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: jfox at mcmaster.ca phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox
I believe it is in the Rcmdr package, which requires the car library to be loaded. You can also perform an ANOVA using the absolute value of the deviations from each respective group mean, which is what Levene's Test does. ------ Harold C. Doran Director of Research and Evaluation New American Schools 675 N. Washington Street, Suite 220 Alexandria, Virginia 22314 703.647.1628 <http://www.edperform.net> -----Original Message----- From: Haynes, Maurice (NIH/NICHD) [mailto:haynesm at cfr.nichd.nih.gov] Sent: Wednesday, August 13, 2003 10:40 AM To: 'r-help' Subject: [R] Levene test of homogeneity of variance Has the Levene test of homogeneity of variance been implemented in any library in R? Thanks, Maurice Haynes National Institute of Child Health and Human Development Child and Family Research Section 6705 Rockledge Drive Bethesda, MD 20892 Voice: 301-496-8180 Fax: 301-496-2766 E-Mail: mh192j at nih.gov ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help