s-news
[Top] [All Lists]

Re: Levene test

To: Christoph Scherber <Christoph.Scherber@uni-jena.de>
Subject: Re: Levene test
From: John Fox <jfox@mcmaster.ca>
Date: Wed, 25 Feb 2004 10:42:24 -0500
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <403C9B24.6050704@uni-jena.de>
Dear Chris,

The following function is from my Rcmdr package for R, and is a slightly modified version of a solution contributed by Brian Ripley to the R-help list:

levene.test <- function(y, group) {
    meds <- tapply(y, group, median, na.rm=TRUE)
    resp <- abs(y - meds[group])
    table <- anova(lm(resp ~ group, na.action=na.omit))
    rownames(table)[2] <- " "
    cat("Levene's Test for Homogeneity of Variance\n\n")
    table[,c(1,4,5)]
    }

For S-PLUS, I've changed the function to specify na.action=na.omit in the call to lm().

I hope this helps,
 John

At 01:55 PM 2/25/2004 +0100, Christoph Scherber wrote:
Dear all,

is there a way to perform a Levene´s test for variance homogeneity in S-Plus?

Best wishes
Chris

-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
phone: 905-525-9140x23604
web: http://socserv.mcmaster.ca/jfox
-----------------------------------------------------


<Prev in Thread] Current Thread [Next in Thread>