scipy.stats.levene¶

scipy.stats.
levene
(*args, **kwds)[source]¶ Perform Levene test for equal variances.
The Levene test tests the null hypothesis that all input samples are from populations with equal variances. Levene’s test is an alternative to Bartlett’s test
bartlett
in the case where there are significant deviations from normality. Parameters
 sample1, sample2, …array_like
The sample data, possibly with different lengths. Only onedimensional samples are accepted.
 center{‘mean’, ‘median’, ‘trimmed’}, optional
Which function of the data to use in the test. The default is ‘median’.
 proportiontocutfloat, optional
When center is ‘trimmed’, this gives the proportion of data points to cut from each end. (See
scipy.stats.trim_mean
.) Default is 0.05.
 Returns
 statisticfloat
The test statistic.
 pvaluefloat
The pvalue for the test.
Notes
Three variations of Levene’s test are possible. The possibilities and their recommended usages are:
‘median’ : Recommended for skewed (nonnormal) distributions>
‘mean’ : Recommended for symmetric, moderatetailed distributions.
‘trimmed’ : Recommended for heavytailed distributions.
The test version using the mean was proposed in the original article of Levene ([2]) while the median and trimmed mean have been studied by Brown and Forsythe ([3]), sometimes also referred to as BrownForsythe test.
References
 1
https://www.itl.nist.gov/div898/handbook/eda/section3/eda35a.htm
 2
Levene, H. (1960). In Contributions to Probability and Statistics: Essays in Honor of Harold Hotelling, I. Olkin et al. eds., Stanford University Press, pp. 278292.
 3
Brown, M. B. and Forsythe, A. B. (1974), Journal of the American Statistical Association, 69, 364367