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

center : {‘mean’, ‘median’, ‘trimmed’}, optional

Which function of the data to use in the test. The default
is ‘median’.

proportiontocut : float, 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 :

W : float

The test statistic.

p-value : float

The p-value for the test.

Notes

Three variations of Levene’s test are possible. The possibilities
and their recommended usages are: