Variances: χ², F, Levene and Fligner–Killeen
H₀: σ = 10 · H₁: σ > 10
χ² = 66.2156 · df = 39 · p = 0.0042
p = 0.0042 ≤ α = 0.05: reject H₀. The spread, s = 13.0301, is further from σ₀ = 10 than chance alone would easily take it, if the data are normal.
How to read the picture
The curve is the null world of the statistic: χ² for one variance, F for two and for Levene's test, χ² for Fligner–Killeen.
The vertical line is your statistic; the shaded area is the p-value.
The χ² and F curves are right only for normal data: with skewed data, trust Levene's or the Fligner–Killeen test.
Below, the interval for the variance or the ratio of variances, where the test has one.
Your data
Test
Alternative hypothesis
Significance level α
A spread can be the thing that matters: a filling line that is right on average but erratic, a book of claims with a heavier tail. The χ² and F tests compare variances directly but trust the data to be normal; Levene's and the Fligner–Killeen tests work on the data's distances from their centre and cope with other shapes.
The estimate and what the data show
The worked steps
The sample variance
s² = 13.0301² = 169.7836The χ² statistic
χ² = (n − 1) s² / σ₀² = 39 × 169.7836 / 100 = 66.2156Degrees of freedom
df = n − 1 = 39The p-value
p = P(χ² ≥ 66.2156) = 0.0042Critical value at α
α = 0.05: χ²* = 54.5722Interval for σ²
95 %: (n − 1) s² / χ²* = [121.3357, ∞)Interval for σ
95 %: √σ² = [11.0152, ∞)
The same in code
- scipy
from scipy import stats chi2 = (40 - 1) * 13.030102**2 / 10**2 df = 40 - 1 p = stats.chi2.sf(chi2, df)- Excel
B1: =(40-1)*13.030102^2/10^2 B2: 39 B3: =CHISQ.DIST.RT(B1, B2)
Formulas
If the data are normal with standard deviation σ₀, (n − 1)s²/σ₀² follows the χ² distribution with n − 1 degrees of freedom. With other shapes it does not, and the test misleads.
Try this
One number, three verdicts
Open line B against the spec and switch the alternative between greater, two-sided and less.
Look for: The one-sided test asks the question the spec asks (more erratic?) and has the smallest p-value; two-sided doubles the smaller tail; 'less' asks the opposite question.
F against Levene
Open the two lines with the F test, then with Levene's test.
Look for: Both compare the same spreads, but F squares the deviations and trusts normality; Levene's test works on absolute deviations from the median, so one outlying bottle moves it less.
Your own data
Choose 'Values I type' and enter two groups, one per line, for example 12, 15, 11, 14, 13 and 9, 18, 7, 20, 16.
Look for: The second group's values sit further from their median, so Levene's W is large even with five values each; with so few, the p-value stays modest.