Tutorials › VEE Mathematical Statistics › A Complete Workflow for Comparing Two Population Variances

VEE Mathematical Statistics · F Distribution and Sampling Results · Tutorial 430 of 880

A Complete Workflow for Comparing Two Population Variances

Learn to carry out and report a two-sample variance comparison while avoiding errors in assumptions, ratio orientation, and tail selection.

Intermediate 11 min read

What You'll Learn

  • Check the conditions required for an exact two-sample F test.
  • Match the numerator and denominator sample variances to their degrees of freedom.
  • Select the ratio orientation to match the alternative hypothesis.
  • Calculate one-sided and two-sided p-values from the F reference distribution.
  • State a conclusion that reflects the test result and its assumptions.

Why a Complete Workflow Matters

A variance comparison is not just a division of two sample variances. The reference distribution depends on which sample variance is in the numerator, the sample sizes, and the assumptions about how the data were collected and distributed. A correct calculation with the wrong degrees of freedom or tail can lead to the wrong conclusion.

The classical F test is exact when the two samples are independent random samples from normal populations. This tutorial uses that setting to organize a complete test: check the assumptions, define the hypotheses, orient the ratio, identify the F distribution, calculate the evidence, and report the conclusion in context. When the assumptions are not credible, the exact F-test conclusions do not automatically apply.

Definition: Let \(X_1,\ldots,X_{n_1}\) be an independent random sample from a normal population with variance \(\sigma_1^2\), and let \(Y_1,\ldots,Y_{n_2}\) be an independent random sample from a normal population with variance \(\sigma_2^2\). The two samples must also be independent of each other. Write \(S_1^2\) and \(S_2^2\) for their unbiased sample variances, calculated with denominators \(n_1-1\) and \(n_2-1\). Under the null hypothesis \(\sigma_1^2=\sigma_2^2\), the statistic \(F=S_1^2/S_2^2\) has an \(F\) distribution with \(n_1-1\) numerator degrees of freedom and \(n_2-1\) denominator degrees of freedom.

The Workflow

Begin with the data-collection design, not the arithmetic. The exact F result requires independent random samples and normally distributed populations. A paired design, repeated measurements on the same individuals, or a sample selected in a way that does not support the random-sampling model fails the stated conditions. Strong departures from normality can also make the classical test unreliable, particularly when samples are small. A variance-ratio result should therefore be reported as conditional on the assumptions, not as a test that is automatically valid for any two data sets.

Next, write the hypotheses in terms of the population variances. For an upper-tailed question, such as whether population 1 has greater variance, use \(H_0:\sigma_1^2=\sigma_2^2\) against \(H_a:\sigma_1^2>\sigma_2^2\). For a lower-tailed question, reverse the inequality. For a two-sided question, use \(H_a:\sigma_1^2\ne\sigma_2^2\). The alternative determines which tail or tails count as evidence against the null.

For a one-sided test, putting the sample variance associated with the direction of the alternative in the numerator often makes the evidence appear in the upper tail. For example, if \(H_a:\sigma_1^2>\sigma_2^2\), use \(F=S_1^2/S_2^2\). If \(H_a:\sigma_1^2<\sigma_2^2\), use that same orientation and look for a small value, or reverse the ratio and use the corresponding upper-tail test. Either choice can work, but the degrees of freedom and tail must follow the ratio actually used.

For a two-sided test, a common convention is to calculate both tail probabilities under the null distribution and double the smaller one, with the result capped at 1. The F distribution is not generally symmetric, so a two-sided p-value is not obtained by doubling the upper-tail probability regardless of the observed statistic. The worked example below uses equal degrees of freedom, for which the two tails are especially easy to calculate.

1
Check the design and model.
Confirm that each sample is random, the samples are independent of each other, and each population is normally distributed for the exact F test.
2
Write the hypotheses and significance level.
Identify whether the alternative is upper-tailed, lower-tailed, or two-sided before choosing a tail probability.
3
Calculate and orient the ratio.
Compute both sample variances, state which is the numerator, and divide in that order.
4
Find the reference distribution.
Use numerator degrees of freedom \(n_1-1\) and denominator degrees of freedom \(n_2-1\), in the same order as the ratio.
5
Calculate the p-value and conclude.
Use the tail or tails specified by the alternative, compare the p-value with the significance level, and state the conclusion in context.

Why the F Reference Distribution Applies

The F reference distribution follows from the sampling distribution of a variance from a normal population. Under the assumptions above, \((n_1-1)S_1^2/\sigma_1^2\) and \((n_2-1)S_2^2/\sigma_2^2\) have chi-square distributions with \(n_1-1\) and \(n_2-1\) degrees of freedom, respectively. The two quantities are independent because the samples are independent.

Under the null hypothesis, the population variances are equal, so the variance terms cancel when the two scaled chi-square quantities are divided. Dividing each by its degrees of freedom gives the ratio of sample variances:

$$ \frac{\{(n_1-1)S_1^2/\sigma_1^2\}/(n_1-1)} {\{(n_2-1)S_2^2/\sigma_2^2\}/(n_2-1)} = \frac{S_1^2}{S_2^2} \quad\text{when }\sigma_1^2=\sigma_2^2. $$

By definition, the ratio of two independent chi-square variables divided by their respective degrees of freedom has an F distribution. Thus \(S_1^2/S_2^2\) has the stated F reference distribution under the null. The order matters: swapping the sample variances also swaps the numerator and denominator degrees of freedom.

Worked Tests

Worked Example: Testing Whether One Population Has Greater Variance

A hypothetical laboratory compares the variability of a measurement produced by two independent instruments. For a random sample from instrument A, the three recorded measurements are 4, 5, and 9 units. For an independent random sample from instrument B, the five measurements are 2, 4, 5, 5, and 4 units. Assume both populations are normal. At significance level \(\alpha=0.05\), test whether instrument A has greater population variance. Report the p-value and conclusion.

Method. Use an upper-tailed two-sample F test, placing \(S_A^2\) in the numerator to match the alternative. The common mistake to avoid is using the larger sample variance as the numerator without also checking that the resulting tail matches the stated alternative.

Check the assumptions. The problem states that the samples are independent random samples and that both populations are normal. These conditions support the exact F reference distribution.

Calculate the sample variances. For A, the sample mean is \((4+5+9)/3=6\). The sum of squared deviations is \((4-6)^2+(5-6)^2+(9-6)^2=4+1+9=14\), so \(S_A^2=14/(3-1)=7\). For B, the sample mean is \((2+4+5+5+4)/5=4\). The sum of squared deviations is \(4+0+1+1+0=6\), so \(S_B^2=6/(5-1)=1.5\).

State the hypotheses and statistic. The hypotheses are \(H_0:\sigma_A^2=\sigma_B^2\) and \(H_a:\sigma_A^2>\sigma_B^2\). The observed statistic is \(F=7/1.5=14/3\approx4.6667\). Its numerator degrees of freedom are \(3-1=2\), and its denominator degrees of freedom are \(5-1=4\), so the null reference distribution is \(F(2,4)\).

For an \(F(2,4)\) random variable, the upper-tail probability at \(f\) is \((1+2f/4)^{-2}\). Therefore, the one-sided p-value is \((1+2(14/3)/4)^{-2}=(1+7/3)^{-2}=(10/3)^{-2}=9/100=0.0900\).

Since \(0.0900>0.05\), do not reject \(H_0\). At the 5% significance level, this sample does not provide sufficient evidence that instrument A's population variance is greater. This is not proof that the population variances are equal; the conclusion is limited to the evidence from this test and its assumptions.

Worked Example: A Lower-Tailed Test and Ratio Orientation

In a hypothetical comparison of two independent, normally distributed production processes, a random sample of five items from process A is 1, 3, 4, 4, and 3 units. A random sample of three items from process B is 0, 1, and 5 units. Test \(H_a:\sigma_A^2<\sigma_B^2\) at \(\alpha=0.10\). Calculate the p-value and state the conclusion.

Method. Put A's variance in the numerator and use a lower-tail F probability. This directly matches the alternative and avoids changing the tail without changing the ratio and degrees of freedom consistently.

Check assumptions and calculate the variances. The samples are stated to be independent random samples from normal populations, so the exact test conditions hold. For A, the mean is \((1+3+4+4+3)/5=3\), and the squared deviations sum to \(4+0+1+1+0=6\). Thus \(S_A^2=6/4=1.5\). For B, the mean is \((0+1+5)/3=2\), and the squared deviations sum to \(4+1+9=14\). Thus \(S_B^2=14/2=7\).

Set the ratio and degrees of freedom. The observed statistic is \(F=S_A^2/S_B^2=1.5/7=3/14\approx0.2143\). Its degrees of freedom are 4 in the numerator and 2 in the denominator, so the null reference distribution is \(F(4,2)\). The p-value is the lower-tail probability \(P(F_{4,2}\le3/14)\).

To evaluate this probability, use the reciprocal identity: if \(F\) has an \(F(4,2)\) distribution, then \(1/F\) has an \(F(2,4)\) distribution. Consequently, \(P(F_{4,2}\le3/14)=P(1/F_{4,2}\ge14/3)\). From the upper-tail formula for \(F(2,4)\), this is \((1+2(14/3)/4)^{-2}=(10/3)^{-2}=0.0900\).

Because \(0.0900<0.10\), reject \(H_0\) at the 10% level. The result provides evidence, at this significance level, that process A has lower population variance than process B.

Common orientation error. Using \(7/1.5=14/3\) as the statistic but retaining the \(F(4,2)\) reference distribution and lower tail would not describe the test just calculated. If the ratio is reversed, the reference degrees of freedom must also be reversed, and the alternative must be expressed using the corresponding upper tail. Keeping the statistic, degrees of freedom, and tail aligned is essential.

Worked Example: A Two-Sided Variance Comparison

A hypothetical researcher compares the variability of a response in two independent normal populations. The first sample consists of 2, 5, and 8; the second consists of 4, 5, and 6. Test equality of the population variances against a two-sided alternative at \(\alpha=0.05\). Calculate the two-sided p-value.

Method. Use the ratio in the stated sample order and double the smaller of the two null tail probabilities. The common mistake to avoid is doubling just one tail without first identifying which tail is smaller.

Check assumptions and calculate the variances. The samples are described as independent random samples from normal populations. For the first sample, the mean is \((2+5+8)/3=5\). The squared deviations sum to \(9+0+9=18\), giving \(S_1^2=18/2=9\). For the second sample, the mean is \((4+5+6)/3=5\). The squared deviations sum to \(1+0+1=2\), giving \(S_2^2=2/2=1\).

Form the statistic and reference distribution. The hypotheses are \(H_0:\sigma_1^2=\sigma_2^2\) and \(H_a:\sigma_1^2\ne\sigma_2^2\). The observed ratio is \(F=9/1=9\), with 2 numerator and 2 denominator degrees of freedom. Thus, under the null, the reference distribution is \(F(2,2)\).

For \(F(2,2)\), the upper-tail probability at \(f\) is \(1/(1+f)\). The upper-tail probability at 9 is \(1/(1+9)=0.10\). The reciprocal identity shows that the lower-tail probability at 9 is the upper-tail probability at \(1/9\), which is \(1/(1+1/9)=0.90\). The smaller tail is 0.10, so the two-sided p-value is \(2(0.10)=0.20\).

Since \(0.20>0.05\), do not reject equality of the population variances. The data do not provide sufficient evidence of a difference at the 5% significance level. The p-value is not the probability that the null hypothesis is true; it is the probability, under the null model, of a result at least as far into the relevant tail or tails as the observed result.

Reporting the Result and Avoiding Traps

A complete report identifies the assumptions, hypotheses, observed ratio, degrees of freedom, p-value, and contextual conclusion. Avoid saying that the samples “prove” equal or unequal variances. A test decision describes how the observed data compare with a null model at a chosen significance level; it does not establish certainty about the population parameters.

  • Do not swap the degrees of freedom independently of the ratio. The first degree of freedom belongs to the sample variance in the numerator; the second belongs to the denominator.
  • Do not choose a tail from the observed ratio alone. Select it from the alternative hypothesis. A statistic above 1 is not automatically an upper-tailed test.
  • Do not apply the exact test to paired observations as if they were independent samples. Dependence changes the sampling argument behind the F distribution.
  • Do not ignore population shape. The classical exact result is based on normal populations. If that assumption is not credible, state the limitation rather than presenting the exact p-value as universally reliable.
  • Do not interpret failure to reject as proof of equality. It means the data did not provide sufficient evidence against the null at the selected significance level.
Key takeaway: An F variance comparison is reliable only when its design assumptions, ratio orientation, degrees of freedom, alternative, and tail probability are all consistent. State each explicitly before interpreting the p-value.

Check Your Understanding

For each problem, check the assumptions and keep the ratio order, degrees of freedom, and alternative aligned.

  1. Two independent normal-population samples have sizes \(n_1=4\) and \(n_2=5\), with sample variances \(S_1^2=6\) and \(S_2^2=2\). For the statistic \(S_1^2/S_2^2\), give the observed value and null reference distribution. (Answer: \(F=3\), with \(F(3,4)\) reference distribution.)
  2. Independent normal-population samples each have size 3 and sample variances 4 and 1. For the upper-tailed alternative that the first population has greater variance, find the p-value. (Answer: \(F=4\), \(F(2,2)\), p-value \(1/(1+4)=0.2000\).)
  3. Independent normal-population samples each have size 3 and sample variances 1 and 4. For the lower-tailed alternative that the first population has smaller variance, find the p-value. (Answer: \(F=0.25\), \(F(2,2)\), lower-tail p-value \(0.25/(1+0.25)=0.2000\).)
  4. Independent normal-population samples each have size 3 and sample variances 9 and 1. Test equality against a two-sided alternative at \(\alpha=0.05\). (Answer: \(F=9\), two-sided p-value \(0.2000\); do not reject equality.)
  5. A study records the same eight people before and after a training program, then proposes to compare the two sample variances using the independent-samples F test. Is the exact independent-samples procedure justified by this design? (Answer: No. The before-and-after samples are paired, not independent, so the stated exact F-test conditions are not satisfied.)
Clinical Biostats