[R] levene.test

Gavin Simpson gavin.simpson at ucl.ac.uk
Wed Jul 14 15:02:33 CEST 2010


On Wed, 2010-07-14 at 05:47 -0700, martanair wrote:
> the value of the F-test is uncorrect.
> If I calculate the Levene's Test for Homogeneity of Variance with SPSS I get
> F = 5.128 Pr (> F) = 0.033
> Why?
> what is the exact formula which R calculate Levene's test for two groups?
> Thanks
> marta

Who says SPSS is correct and that levene.test isn't? ;-) Please don't
make such statements when you clearly don't know what it is that the R
code is computing. There are quite a few "versions" of Levene's test and
R and SPSS may not be implementing the same thing.

require(car)
car:::levene.test.default

Will show you the source code. Read ?levene.test to see what it is
doing, in particular:

Details:

     The version of Levene's test implemented here is based on absolute
     deviations from the group medians. Other, less robust, versions,
     not implemented, are based on absolute deviations from group means
     or trimmed means.

As far as I can tell, my reading of the code show using the above R call
is doing exactly what it was supposed to; i.e. ANOVA of the deviations
from group medians with group identifier as the sole covariate.

Can you look at the SPSS code for this and verify that what it is doing
is likewise correct? (Genuine Q as I don't own, nor have ever used
SPSS).

G
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list