[R] Difference in Levene's test between R and SPSS

Peter Ehlers ehlers at ucalgary.ca
Mon Feb 15 05:50:27 CET 2010


Ravi Kulkarni wrote:
> Hello,
>   I notice that when I do Levene's test to test equality of variances across
> levels of a factor, I get different answers in R and SPSS 16.
>   e.g.: For the chickwts data, in R, levene.test(weight, feed) gives
> F=0.7493, p=0.5896.
> SPSS 16 gives F=0.987, p=0.432
> 
>   Why this difference? Which one should I believe? (I would like to believe
> R :)

When in doubt, believe R.

Which levene.test() are you using? There are at least three
functions by that name (packages car, lawstat, s20x; you
should always state which package is being used).

All default to what I would consider to be the better test,
namely using the median as location measure. lawstat gives
you options: try it with location="mean".

Then switch to the Fligner-Killeen test (fligner.test() in
package 'stats'). The reference cited in ?fligner.test makes
for good reading.

  -Peter Ehlers

> 
>   Ravi



More information about the R-help mailing list