Calculator
Online calculator that computes the statistic, the p-value and the decision for tests on one variance or on two variances.
Explanation
The variance test is used to check whether the variability of a population is compatible with a theoretical or reference value. Unlike tests on the mean, this test doesn't analyze whether the data are higher or lower on average, but whether they are more or less spread out than expected.
In industry, laboratory work and quality control, the average isn't the only thing that matters: variance defines risk, consistency and stability. A process can have a correct mean and still be too irregular.
For example, a machine may fill bottles with the correct average amount of liquid, but do so with too much variability. Even if the average is right, an excessive variance would mean some bottles are overfilled and others underfilled. The variance test lets you check whether the spread observed in a sample is compatible with the variability considered acceptable.
For a single variance, a test based on the chi-square distribution is used. To compare two variances, a test based on the F distribution is typically used. In both cases, the classical tests assume the data come from populations that are approximately normal.
Hypotheses and statistic
\(H_0: \sigma^2 = \sigma_0^2\)
\( \chi^2 = \frac{(n-1)s^2}{\sigma_0^2} \)
\(H_0: \sigma_1^2 = \sigma_2^2\)
\( F = \frac{s_1^2}{s_2^2} \)
- \(s^2\): observed sample variance (chi-square test).
- \(\sigma_0^2\): reference variance under \(H_0\) (chi-square test).
- \(n\): sample size; \(df = n-1\) degrees of freedom (chi-square test).
- \(s_1^2, s_2^2\): sample variances of the two groups (F test).
- \(n_1, n_2\): sizes of the two groups; \(df_1 = n_1-1\), \(df_2 = n_2-1\) (F test).
Quick test
In the one-variance test, the statistic compares the sample variance \(s^2\) with a reference variance \(\sigma_0^2\). Under \(H_0\), the statistic follows a chi-square distribution with \(n-1\) degrees of freedom:
\( \chi^2 = \frac{(n-1)s^2}{\sigma_0^2} \sim \chi^2_{n-1} \)
In the comparison of two variances, the statistic compares the ratio between the two sample variances. Under \(H_0\), it follows an F distribution:
\( F = \frac{s_1^2}{s_2^2} \sim F_{n_1-1,\;n_2-1} \)
If the result is significant, it's worth reviewing possible sources of variation: batches, shifts, instrumentation, supplier changes, measurement conditions or differences between groups.
Worked example
Suppose you want to compare the variability of two screw-manufacturing processes. Process A: sample variance \(s_1^2 = 25\) mm², \(n_1 = 21\) units. Process B: sample variance \(s_2^2 = 16\) mm², \(n_2 = 16\) units. We test \(H_0\colon \sigma_1^2 = \sigma_2^2\) against \(H_1\colon \sigma_1^2 \neq \sigma_2^2\) with \(\alpha = 0.05\), two-sided, using Snedecor's F test.
The F statistic is computed as the ratio of variances (larger over smaller):
\( F = \dfrac{s_1^2}{s_2^2} = \dfrac{25}{16} = 1.5625 \)
The degrees of freedom are \(df_1 = n_1 - 1 = 20\) and \(df_2 = n_2 - 1 = 15\). For a two-sided test with \(\alpha = 0.05\), the upper critical value is \(F_{0.025;\,20,\,15} \approx 2.76\). The lower critical value is \(F_{0.975;\,20,\,15} \approx 1/F_{0.025;\,15,\,20} \approx 0.39\).
Since \(0.39 < F = 1.5625 < 2.76\), the statistic doesn't fall in either rejection tail. The two-sided p-value is \(p \approx 0.38 > 0.05\).
Conclusion: fail to reject \(H_0\). The data don't provide significant evidence that the two processes have different variances. Both processes show comparable spread at the 5% significance level.
How to interpret the result
Rejecting \(H_0\) (p-value < \(\alpha\)) means the sample variance \(s^2\) is statistically incompatible with the hypothesized value \(\sigma^2_0\). In practical terms, there's evidence that the variability of the process or population differs from the reference. However, the chi-square test for one variance is notably sensitive to departures from normality: a rejection can reflect a skewed or heavy-tailed distribution rather than a genuinely different variance. Always complement it with a plot of the data (histogram, Q-Q plot) and consider the context of the problem.
Failing to reject \(H_0\) (p-value ≥ \(\alpha\)) doesn't prove that \(\sigma^2 = \sigma^2_0\); it only indicates that the data are compatible with that value at the chosen level. With small samples, the power to detect changes in variance is generally low. The confidence interval for \(\sigma^2\) — based on percentiles of the chi-square distribution with \(n-1\) degrees of freedom — offers a more complete picture of the range of plausible values.
The chi-square statistic \(\chi^2 = (n-1)s^2/\sigma^2_0\) measures how far the sample variance is from the hypothesized one. In the chart, the green region represents the non-rejection zone and the red zones the critical regions (one-sided or two-sided depending on the chosen alternative); the amber line marks the observed statistic. Unlike mean tests, the chi-square distribution isn't symmetric, so the critical values differ between the two tails even for the same \(\alpha\).
Frequently asked questions
- When do I use the one-variance test? When you want to check whether the population variance is compatible with a theoretical or reference value.
- When do I use the two-variance test? When you want to compare whether two populations or conditions have the same spread.
- What assumption matters most? The classical variance tests assume the data come from approximately normal populations.
- Can two processes share the same mean but differ in variance? Yes. Two processes can have the same average and still show very different variability.
- Which tail should I choose? Two-sided if you're looking for any difference; right tail if you want to check whether the variance is larger; left tail if you want to check whether the variance is smaller.
Reference: F-test of equality of variances — Wikipedia