Explore

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

n = 40

n (sample size)

s = 13.030102

s (sample standard deviation)
σ₀ (the standard deviation the spec allows)

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 estimate with its interval Sample standard deviation (interval for σ): 13.03 [11.02, Infinity]. σ₀, the spec. σ₀, the specSample standard deviation (interval for σ) 13.03 [11.02, Infinity] 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5standard deviation
This test is valid only for normal data, and it is very sensitive to other shapes: look at the data before trusting it.

The worked steps

  1. The sample variance

    s² = 13.0301² = 169.7836
  2. The χ² statistic

    χ² = (n − 1) s² / σ₀² = 39 × 169.7836 / 100 = 66.2156
  3. Degrees of freedom

    df = n − 1 = 39
  4. The p-value

    p = P(χ² ≥ 66.2156) = 0.0042
  5. Critical value at α

    α = 0.05: χ²* = 54.5722
  6. Interval for σ²

    95 %: (n − 1) s² / χ²* = [121.3357, ∞)
  7. 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)
scipy and Excel have no one-variance test as such: the statistic is computed by formula and the tail comes from the χ² distribution.

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

  1. 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.

  2. 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.

  3. 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.

An unhandled error has occurred. Reload 🗙

Reconnecting…

Your connection to Hypothesis Testing Lab dropped, probably a Wi-Fi blip. Hold on while it reconnects.

The connection could not be restored. The page will reload in a few seconds.