How this calculation works
Levene-type tests compare dispersion by transforming each observation into its absolute deviation from a within-group center. A one-way ANOVA calculation is then applied to those deviations. Mean centering gives the original Levene form, while median centering gives the Brown–Forsythe variant and can be less sensitive to skew or outliers. The page displays the chosen centers, mean absolute deviations and F degrees of freedom. It tests a variance-homogeneity hypothesis under its assumptions, not whether the original group means differ.
Zᵢⱼ=|Xᵢⱼ−centerᵢ|; W=[(N−k)/(k−1)] Σnᵢ(Z̄ᵢ−Z̄)² / Σ(Zᵢⱼ−Z̄ᵢ)².A worked example
For groups (1,2,3,4), (2,4,6,8) and (1,3,5,7), mean and median centers are 2.5,5 and 4. The absolute-deviation means are 1,2 and 2. Their grand mean is 5/3. Between-group squared deviation is 8/3, while within-group squared deviation is nine. With N=12 and k=3, W=(9/2)×(8/3)/9=4/3. The reference F distribution has numerator degrees of freedom two and denominator degrees of freedom nine.
Good to know
2–10 independent groups with 2–500 finite observations each. Only mean or median centering is supported; no trimmed-center option is implied. The F approximation needs positive informative within-group deviation variance, otherwise an explicit undefined-statistic error is returned. No paired observations, clustering correction, missing-value deletion or automatic selection of a later mean-comparison method. Nonsignificance does not demonstrate equal variances or practical equivalence.
Reference: SciPy — Levene and Brown–Forsythe center conventions (opens in a new tab) ↗
The transformed data carry the dispersion question
Within each group, distance from a representative center measures spread without retaining the original sign. Comparing average absolute distances then asks whether groups show similar dispersion. The original observations are not pooled before finding their centers: each group has its own mean or median. Using one grand center would mix location differences into the deviation construction and would no longer be the stated Levene or Brown–Forsythe procedure.
The ANOVA decomposition is applied to absolute deviations, not to squared original residuals. Between-group variation measures differences in average absolute deviation, and within-group variation measures scatter of those deviations. The reported sample centers and deviation means provide a direct way to check this transformation by hand. Unequal group sizes are supported through their actual observation counts in the weighted grand mean and degrees of freedom.
Choose a robust procedure for the question, not a convenient p-value
Median centering can reduce sensitivity to an extreme observation’s effect on the center, but it does not make data quality or group independence irrelevant. Skewed distributions and very small samples can affect the reference approximation. A few repeated values can also produce constant absolute deviations; if the within-deviation sum of squares vanishes, the usual F ratio has no valid denominator and this page reports that problem instead of returning an arbitrary zero.
A nonsignificant result is not evidence that variances are exactly equal. Likewise, a significant result does not explain which physical mechanism changed dispersion or whether a difference matters practically. Selecting a mean test only after a preliminary variance p-value is a separate analysis strategy and can distort error rates. The Welch ANOVA calculator for unequal variances tests means under a heteroscedastic model; this page specifically tests homogeneity of variance and keeps that interpretation distinct.
A few questions, answered
Is Brown–Forsythe a separate calculation page?
It is a center option here. Both methods transform observations into within-group absolute deviations and use the same F decomposition with a different selected center.
Does this test compare the original means?
No. It compares dispersion through absolute deviations. Mean differences require a separately justified mean-comparison procedure.