1 variance test: chi-square test for a standard deviation

Updated

The 1 variance test checks whether the standard deviation (or variance) of a process differs from a stated value. The classic version is the chi-square test, which compares the sample variance with the target variance and gives an exact p-value and interval when the data are normal. Because it is sensitive to non-normal data, a good tool also offers Bonett's method, which stays reliable when the distribution has heavier or lighter tails than the normal.

When to use it

  • A process must hold a maximum standard deviation, for example to reach a capability target, and you want evidence that it does.
  • You are qualifying a new machine, fixture or supplier on consistency, not just on its mean.
  • You want a confidence interval for σ to judge how precisely a sample estimates the process spread.
  • To compare the spread of two groups, use the 2 variances test.

How it works

Hypotheses, with σ the process standard deviation and σ₀ the stated value:

  • H₀: σ = σ₀.
  • H₁: σ ≠ σ₀, or σ < σ₀, or σ > σ₀.

To show that a process is consistent enough, the alternative is usually σ < σ₀: the burden of proof is on the process.

Chi-square test. With s the sample standard deviation:

χ² = (n − 1) s² / σ₀², df = n − 1

For H₁: σ < σ₀, the p-value is the lower tail P(χ²ₙ₋₁ ≤ χ²). For H₁: σ > σ₀ it is the upper tail, and for a two-sided test twice the smaller tail.

The confidence interval for σ is:

s · √((n − 1) / χ²(1 − α/2, n − 1)) ≤ σ ≤ s · √((n − 1) / χ²(α/2, n − 1))

The chi-square method assumes normal data, and it is not robust: heavy tails make it reject too often, light tails too rarely, and the problem does not go away with large samples.

Bonett's method adjusts the interval with an estimate of the kurtosis of the data, so its coverage stays close to the stated level for a wide range of shapes. It gives nearly the same answer as the chi-square method on normal data. When the normality test fails, or you have reason to expect heavy tails, prefer Bonett's.

Example

A grinding cell finishes piston pins to a diameter of 18.000 ± 0.008 mm. To reach a Cp of at least 1.33 on a tolerance 16 µm wide, the standard deviation must be at most 16/(6 × 1.33) = 2.0 µm. After rebuilding the grinder spindle, a quality engineer measures 25 consecutive pins and records each as a deviation from 18.000 mm, in µm:

Deviation (µm)
−1.10.50.00.10.4
−0.6−2.20.0−1.12.7
0.02.90.82.00.1
−1.11.32.2−0.71.2
−0.60.5−2.52.51.2
Piston pin diameter deviation after the spindle rebuild02468FrequencyLSLUSLTarget-505Deviation from 18.000 mm (µm)
Piston pin diameter deviation after the spindle rebuild

The sample standard deviation is s = 1.439 µm. The engineer tests H₀: σ = 2.0 against H₁: σ < 2.0 at α = 0.05:

  • χ² = 24 × 1.439² / 2.0² = 24 × 2.0717 / 4 = 12.43, with 24 degrees of freedom.
  • p-value = P(χ²₂₄ ≤ 12.43) = 0.025.
  • One-sided 95% upper bound: σ ≤ 1.439 × √(24/13.848) = 1.895 µm, where 13.848 is the 5th percentile of χ²₂₄.
  • Two-sided 95% CI for σ: 1.124 to 2.002 µm.

An Anderson–Darling test gives p = 0.71, so the chi-square method's normality assumption is reasonable for these data.

How to read the results

  • The p-value of 0.025 is below 0.05, so the data support the claim that σ is below 2.0 µm. The rebuilt grinder meets the consistency requirement.
  • The upper bound is the number to report. With 95% confidence, σ is at most 1.895 µm. In capability terms, a centered process with that σ has Cp of at least 16/(6 × 1.895) = 1.41.
  • The two-sided interval reaches 2.002. That is not a contradiction: it puts 2.5% in each tail, while the one-sided test puts all 5% on the side that matters. Decide which you need before collecting data.
  • The point estimate is better than the bound. s = 1.44 µm corresponds to Cp ≈ 1.85. The gap between 1.85 and 1.41 is the price of a sample of 25; a larger sample narrows it.

Common mistakes

  • Using the chi-square test on skewed or heavy-tailed data. It can be badly wrong even with large samples. Check normality, and use Bonett's method when in doubt.
  • Testing the wrong direction. If you want to prove σ is small enough, H₁ must be σ < σ₀. Testing H₁: σ ≠ σ₀ and not rejecting proves nothing.
  • Measuring with a gauge that is too coarse. If the gauge resolution or repeatability is close to the process σ, the test measures the gauge. Check the measurement system first.
  • Treating consecutive parts as the whole story. 25 pins in a row show short-term spread. Tool wear and day-to-day shifts add variation that a short run cannot see.

Frequently asked questions

Should I test the variance or the standard deviation?

They are the same test, since σ < σ₀ exactly when σ² < σ₀². Report the standard deviation, because it is in the units of the measurement and easier to compare with a tolerance.

Why is the confidence interval for σ not symmetric?

The chi-square distribution is skewed to the right, so the interval stretches further above s than below it. The skew is strongest for small samples.

When should I use Bonett's method instead of the chi-square test?

Whenever the data may not be normal: a failed normality test, a known skewed process or visible outliers. On normal data the two give nearly the same answer, so Bonett's is a safe default.

How many parts do I need to show σ is below a limit?

It depends on how far below the limit the true σ is. If σ is only slightly below σ₀, you need many parts. See sample size for 1 variance.

Try it with your own data

StatLab SPC is free, open-source statistics for engineers. It runs in your browser, works offline, and never uploads your data.

Open StatLab