# [R] Levene's test

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Fri Sep 1 09:54:59 CEST 2000

Prof Brian D Ripley <ripley at stats.ox.ac.uk> writes:

> Levene <- function(y, group)
> {
>     group <- as.factor(group)  # precautionary
>     meds <- tapply(y, group, median)
>     resp <- abs(y - meds[group])
>     anova(lm(resp ~ group))[1, 4:5]
> }
>
> > data(warpbreaks)
> > attach(warpbreaks)
> > Levene(breaks, tension)
>       F value  Pr(>F)
> group   2.818 0.06905
>
> I could (and probably would) dress it up with a formula interface,
> but that would obscure the simplicity of the calculation.

Cough. Is that really the calculation of the P value in Levene's test?
Just close your eyes an pretend that F is F distributed? Not that I
don't believe that it might be the case, I just sort of expected that
something more elaborate was required.

I've been wondering whether we should have L's test, if for no other
reason then because SPSS uses it by default.

Hmm. So we have a test (Bartlett's) which is known to be optimal under
Normal theory, then SPSS goes and replaces with a test which uses an
arbitrary quantity, known to be suboptimal in the Normal case, and
tests a hypothesis that isn't actually what it purports to be
(identical variances does not follow from identical mean absolute
residuals), and to top it off uses a certainly incorrect calculation
of its p-value. Well, yes they would, wouldn't they?

--
O__  ---- Peter Dalgaard             Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics     2200 Cph. N
(*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._