ADescribe · Guide test 095
Fligner–Killeen test
Tests scale homogeneity using ranked absolute deviations and normal scores.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Equal spread tests — Do two or more groups have the same spread?
In Equal spread tests, choose Test = Fligner–Killeen.
Do it in CodeSplash Run this test on your own data, in Python or R.
Bench
Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.
Bench · Fligner–Killeen test
Group i has true mean (i − 1) × spread.
Your data
Drag a point or use ↑/↓ to change itIf H₀ were true
- The reference: how χ² varies across samples when H₀ is true.
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .340).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- rank of |xᵢ − group median|
- half-normal scores
The verdict
χ²(2) = 2.16, p = .340
p > α = .050: compatible with H₀
Among the most robust tests of equal variances; preferred when data are skewed or have outliers.
- Statistic
- 2.159
- p-value
- 0.3398
Fligner–Killeen test on Group 1: n = 15; Group 2: n = 15; Group 3: n = 15: χ²(2) = 2.16, p = .340. The p-value is above α = .050, so the data are compatible with H₀.
Question and hypotheses
H0: group scales are equal under a common shape model.
Assumptions
Independent groups; median centering and ranks provide robustness, but comparable shapes are needed for a pure scale interpretation.
Formula
Parameters and notation
Ri ranks absolute deviations from each group median; sa² is pooled score variance with denominator N−1.
Structure of the method
Center observations by their group medians, rank pooled absolute deviations, convert those ranks to normal scores, and compare group score means using their pooled score variance. The omnibus quadratic statistic is commonly calibrated with chi-square degrees of freedom equal to the number of groups minus one.
Estimated and nuisance parameters
Estimate medians, deviation ranks, normal-score means, and score variance. Tie groups affect the rank transformation. The result tests a scale-oriented contrast; translating it into a statement solely about population variance assumes comparable distributional shapes.
Settings and design choices
Specify median centering, tie-score convention, group definitions, asymptotic versus a documented conditional variant, and alpha. Different packages can implement related rank-score procedures with different conditioning, so a common method name alone does not establish identical small-sample p-values.
Fitting and adaptation
Recompute centers and rank scores when data or groups change. A simulation assessment should reproduce centering and ties under the intended common-shape scale model. There is no fine-tuning. For clustered groups, use a design-aware extension rather than merely increasing the nominal observation count.
Sensitivity and robustness
Coarse discrete outcomes can create many zero deviations and ties. Different skewness or tail shapes can influence the test even when variance is unchanged. Small groups and unbalanced designs warrant scrutiny. A stable p-value across related robust tests is descriptive evidence, not a multiplicity-free combined test.
How to use and calibrate
Use χ²k−1 asymptotically, or a documented conditional/resampling version.
Example application
Check scale heterogeneity when normality is doubtful.
Interpretation and pitfalls
Watch out
Different shapes or location estimation can influence the statistic; this is not proof that variances are equal when nonsignificant.
What changed in edition 2
- New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.
Python and R
Variance/scale homogeneity, not a test of equal means. Center choice distinguishes Levene from its median-centered Brown–Forsythe version.
Validated — Executed successfully in the validation environment · needs numpy, scipy
import numpy as np
from scipy import stats
rng = np.random.default_rng(2026)
groups = [rng.normal(m,1,20) for m in (0,.4,.8)]
print(stats.fligner(*groups,center="median"))
Output
FlignerResult(statistic=np.float64(5.166188575976257), pvalue=np.float64(0.07553989981209702))
Validated — Executed successfully in the validation environment · needs Base/standard library
set.seed(2026)
d <- data.frame(value=c(rnorm(20),rnorm(20,.4),rnorm(20,.8)), group=factor(rep(c("A","B","C"),each=20)))
print(fligner.test(value~group,d))
Output
Fligner-Killeen test of homogeneity of variances data: value by group Fligner-Killeen:med chi-squared = 0.059532, df = 2, p-value = 0.9707
Sources
- R stats — R stats · fligner.teststat.ethz.ch
- fligner.teststat.ethz.ch
- Statistics guide v4 (historical):
- R: Executed successfully in the validation environment
- Reference's record:
- Edition 2 review: Python: executed · R: not executed (Rscript unavailable). Python: Ran in the reference's review, on this exact code. R: Reviewed but not run: R wasn't available to the reference's authors.
From the CodeSplash statistics guide (v4), entry 095, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT095.