Sample size for a 1-variance test (chi-square method)
Sample size for a 1-variance test tells you how many units to measure so that a 1-variance test detects a given change in a process standard deviation with a chosen power. For normal data the test statistic follows a chi-square distribution, so power and sample size can be computed exactly, without approximation. The answers are larger than many people expect, because a standard deviation is much harder to pin down than a mean.
When to use it
- You want to show that a new fixture, machine or material reduces variation below the current σ.
- A customer or standard sets a maximum standard deviation and you need to demonstrate compliance.
- You are comparing a gauge's repeatability against a required value.
How it works
The test compares the sample standard deviation s with a reference value σ₀ through
χ² = (n − 1) s² / σ₀²which follows a chi-square distribution with n − 1 degrees of freedom when σ = σ₀. To show the standard deviation is smaller than σ₀, reject H₀ when χ² < χ²α,n−1 (the lower α quantile). If the true value is σ₁, then (n − 1)s²/σ₁² is chi-square, and the power is
Power = P( χ²ₙ₋₁ < (σ₀/σ₁)² × χ²α,n−1 )Increase n until the power reaches the target. Only the ratio σ₁/σ₀ matters. For a test that σ is larger than σ₀, use the upper quantile and the upper tail; for a two-sided test, use both tails with α/2 each.
A rough starting point uses the fact that ln s is nearly normal with standard deviation 1/√(2(n − 1)):
n ≈ 1 + ½ ( (z₁₋α + z₁₋β) / ln(σ₀/σ₁) )²Example
A grinding operation holds a diameter with σ₀ = 0.020 mm. A new work-holding fixture should reduce that to about 0.014 mm, a ratio of 0.7. The engineer wants a one-sided test at α = 0.05 with 90% power to show the reduction.
- Approximation: 1 + ½ × ((1.645 + 1.282) / ln(1/0.7))² = 34.7, so 35 parts. The exact power with 35 parts is 0.887, just short.
- Exact chi-square: 36 parts give 0.896; 37 parts give 0.905.
With 37 parts, χ²₀.₀₅,₃₆ = 23.27, so the decision rule is: conclude the fixture reduced variation if s < 0.020 × √(23.27/36) = 0.0161 mm. A simulation of 200,000 samples of 37 parts with σ = 0.014 mm (NumPy, seed 5) met that rule 90.5% of the time.
If the engineer wanted a two-sided test (any change in σ), the same 90% power would take 46 parts.
How to read the results
- A 30% reduction needs about 37 parts for 90% power. A 20% reduction (ratio 0.8) would be detected only 55% of the time with the same 37 parts.
- Small samples see only big changes. With 10 parts, even halving σ is detected only 85% of the time.
- The decision rule is concrete. Writing the critical s (0.0161 mm here) into the plan before collecting data prevents later arguments.
- A failed test is not proof of no improvement. If s comes out at 0.017 mm, the data are consistent with both no change and a modest reduction. Report the confidence interval for σ.
Common mistakes
- Ignoring non-normality. The chi-square test for a variance is very sensitive to the tails of the distribution. With heavy tails, its α can be far from nominal. Check normality, or use a more robust method and size it by simulation.
- Short-term samples. Thirty-seven consecutive parts show short-term variation only. If the claim is about the long-term σ, spread the parts over shifts, tool changes and material lots.
- Gauge variation in s. The measured s includes measurement error. If the gauge's repeatability is a sizable part of 0.014 mm, it can mask the improvement. Check the measurement system first.
- Comparing with a σ₀ that was itself estimated from a small sample. Then you are really comparing two variances and should plan a 2-variances test.
Frequently asked questions
Why do variance tests need so many units?
The sampling distribution of s is wide. With 20 values, a 95% confidence interval for σ runs from about 0.76s to 1.46s. Small changes in σ hide inside that range.
Is the calculation exact?
Yes, for normally distributed data. The chi-square distribution of (n − 1)s²/σ² is exact under normality, and only the sample size has to be found by search.
Can I use the range instead of the standard deviation?
For small subgroups the range is nearly as efficient, but tests and sample size methods are built on s. Use s for this kind of decision.
What if I need to show σ is below a limit, not just lower than before?
The method is the same: set σ₀ to the limit and plan to reject H₀ when s is small enough. A process that is only slightly below the limit will need a very large sample to show it.