Purpose and Model
A variance comparison asks whether one population is more variable than another. For example, a hypothetical analyst might compare the variability of processing times under two procedures. An upper-tailed F test is appropriate when the question is specifically whether the first population variance exceeds the second. The order of the samples matters: the first variance goes in the numerator, and the direction of the alternative determines which tail is used.
The classical test is exact under a particular model. The two samples must be independent of one another, observations within each sample must be independent, and each population must have a normal distribution. The sample sizes may differ. If these assumptions are not reasonable, the exact F reference distribution described here is not guaranteed.
For observations \(X_{11},\ldots,X_{1n_1}\) and \(X_{21},\ldots,X_{2n_2}\), the unbiased sample variances are
The test statistic is \(F=s_1^2/s_2^2\). Under the equal-variance null hypothesis, it has an \(F\) distribution with numerator degrees of freedom \(\nu_1=n_1-1\) and denominator degrees of freedom \(\nu_2=n_2-1\). The numerator degrees of freedom belong to the variance in the numerator; the denominator degrees of freedom belong to the variance in the denominator.
Why the F Statistic Has This Distribution
For a normal sample, the scaled sample variance \((n-1)s^2/\sigma^2\) has a chi-square distribution with \(n-1\) degrees of freedom. This result applies separately to each sample. Independence of the samples makes the two scaled sample variances independent as well.
Write \(U=(n_1-1)s_1^2/\sigma_1^2\) and \(V=(n_2-1)s_2^2/\sigma_2^2\). Under the null hypothesis, \(\sigma_1^2=\sigma_2^2\), so the population variances cancel when forming the ratio:
The ratio of two independent chi-square variables, each divided by its degrees of freedom, has an \(F\) distribution. Thus \(F\sim F(n_1-1,n_2-1)\) under the null. This also explains why putting the larger observed variance on top is not a harmless rearrangement: it changes the statistic and its associated degrees of freedom.
For a null ratio other than one, the statistic must be adjusted. If the boundary hypothesis is \(\sigma_1^2/\sigma_2^2=r_0\), use \(F=(s_1^2/s_2^2)/r_0\). Under that boundary, this adjusted statistic has the stated \(F\) distribution. The examples below use the equal-variance boundary \(r_0=1\).
Test Procedure
Identify which population is claimed to have the larger variance. Place that population first, and state an upper-tail alternative.
Use the sum of squared deviations from each sample mean and divide by that sample's size minus one.
Calculate \(F=s_1^2/s_2^2\), with \(\nu_1=n_1-1\) and \(\nu_2=n_2-1\).
Find \(P(F_{\nu_1,\nu_2}\geq F_{\text{observed}})\), or compare the statistic with the upper-tail critical value for the stated significance level.
Reject \(H_0\) if the p-value is at most the significance level. Otherwise, state that the evidence is insufficient to conclude that the first population variance is larger.
The p-value is the probability, assuming the null boundary is true, of obtaining an \(F\) statistic at least as large as the observed statistic. The critical value \(c\) for significance level \(\alpha\) is defined by \(P(F_{\nu_1,\nu_2}\geq c)=\alpha\). Reject when \(F_{\text{observed}}\geq c\). The F table or probability calculation must use the numerator and denominator degrees of freedom in the correct order.
Worked Upper-Tail Tests
Worked Example: A Near-Boundary Result
Two independent samples are taken from normal populations. The first sample is \(4,8,12\), and the second is \(3,4,5,6,7\). Test at the 5% significance level whether the first population variance exceeds the second. Use the upper-tail p-value.
Method and hypotheses. The samples are independent and the populations are assumed normal. Set \(H_0:\sigma_1^2=\sigma_2^2\) and \(H_1:\sigma_1^2>\sigma_2^2\). This is an upper-tail test, so the first sample variance goes in the numerator.
First sample variance. Its mean is \((4+8+12)/3=8\). Its squared deviations sum to \((4-8)^2+(8-8)^2+(12-8)^2=16+0+16=32\). Therefore \(s_1^2=32/(3-1)=16\).
Second sample variance. Its mean is \((3+4+5+6+7)/5=5\). Its squared deviations sum to \(4+1+0+1+4=10\). Therefore \(s_2^2=10/(5-1)=2.5\).
Statistic and degrees of freedom. The observed statistic is \(F=16/2.5=6.4\). The degrees of freedom are \(\nu_1=3-1=2\) and \(\nu_2=5-1=4\).
For \(F(2,4)\), the upper-tail probability at \(x\) is \(\left(2/(2+x)\right)^2\). Thus the p-value is
Since \(0.0567>0.05\), do not reject \(H_0\). At the 5% level, the data do not provide sufficient evidence that the first population variance is larger. The p-value is close to 0.05, but being close does not change the decision rule.
Check. The sample variances are positive and \(16/2.5=6.4\); the tail probability is just above 0.05, consistent with a statistic just below the 5% upper critical value.
Common mistake avoided: A ratio above one does not by itself establish significance. The relevant comparison is with the upper-tail distribution for the correct degrees of freedom.
Worked Example: Rejecting at the 5% Level
A hypothetical laboratory compares measurement variability under two independent procedures. Normality is assumed for both populations. The recorded values are \(0,5,10\) for procedure 1 and \(4,5,6\) for procedure 2. At the 5% level, test whether procedure 1 has the larger population variance.
Method and hypotheses. Use \(H_0:\sigma_1^2=\sigma_2^2\) against \(H_1:\sigma_1^2>\sigma_2^2\). The independent normal-sample model allows the sample-variance ratio to be compared with an \(F\) distribution.
Calculate the variances. The first mean is \((0+5+10)/3=5\), and its squared deviations sum to \(25+0+25=50\). Hence \(s_1^2=50/2=25\). The second mean is \((4+5+6)/3=5\), and its squared deviations sum to \(1+0+1=2\). Hence \(s_2^2=2/2=1\).
Statistic and degrees of freedom. The ratio is \(F=25/1=25\), with \(\nu_1=2\) and \(\nu_2=2\). For \(F(2,2)\), the upper-tail probability at \(x\) is \(1/(1+x)\). The p-value is therefore
Because \(0.0385<0.05\), reject \(H_0\). The result provides evidence, at the 5% level, that procedure 1's population variance is larger. This conclusion concerns variability, not which procedure has the larger population mean.
Check. The 5% upper critical value for \(F(2,2)\) is 19, since \(1/(1+19)=0.05\). The observed value 25 exceeds 19, agreeing with the p-value decision.
Common mistake avoided: The order of the ratio follows the direction of the alternative. Reversing the ratio would produce \(1/25\), which is not the statistic for this upper-tail claim.
Worked Example: A Larger Denominator Sample
Two independent normal populations are sampled. The first sample is \(0,3,6\); the second is \(-1,-1,-1,0,1,1,1\). At significance level 0.05, test whether the first population variance exceeds the second.
Method and hypotheses. Use the upper-tail F test with \(H_0:\sigma_1^2=\sigma_2^2\) and \(H_1:\sigma_1^2>\sigma_2^2\). Keep the sample labels in the same order in the statistic and its degrees of freedom.
First sample variance. Its mean is \((0+3+6)/3=3\), and the squared deviations sum to \(9+0+9=18\). Thus \(s_1^2=18/2=9\).
Second sample variance. Its mean is zero because its entries sum to zero. The squared deviations sum to \(1+1+1+0+1+1+1=6\), so \(s_2^2=6/(7-1)=1\).
Statistic and degrees of freedom. The observed ratio is \(F=9/1=9\), with \(\nu_1=3-1=2\) and \(\nu_2=7-1=6\). For \(F(2,6)\), the upper-tail probability at \(x\) is \(\left(3/(3+x)\right)^3\). The p-value is
Since \(0.0156<0.05\), reject \(H_0\). There is evidence at the 5% level that the first population variance is larger. As a critical-value check, solving \(\left(3/(3+c)\right)^3=0.05\) gives \(c=3(0.05^{-1/3}-1)\approx5.143\). The observed value \(9\) is above this critical value.
Check. The second sample has six degrees of freedom, not seven; using seven would give the wrong reference distribution and tail probability.
Common mistake avoided: Count the degrees of freedom from each sample size separately. The numerator degrees of freedom are 2, while the denominator degrees of freedom are 6.
Interpretation and Exam Traps
A test decision is about evidence under a specified model. Rejecting the null supports the upper-tail claim at the chosen significance level; it does not prove the alternative true. Failing to reject means the evidence did not meet the chosen threshold. It does not establish that the population variances are equal.
A useful check is to write the labels beside the ratio before substituting numbers: \(F=s_1^2/s_2^2\), with \((\nu_1,\nu_2)=(n_1-1,n_2-1)\). For an upper-tail alternative, a larger first-sample variance should produce a larger statistic. The p-value is the probability to the right of that statistic, not the probability to its left.
For instance, an incorrect calculation might reverse the ratio in Worked Example 2 and use \(1/25=0.04\), then look up a lower-tail probability. That calculation answers a different directional question and does not test whether \(\sigma_1^2>\sigma_2^2\). The correction is to retain \(25/1=25\), use numerator degrees of freedom 2 and denominator degrees of freedom 2, and calculate the upper-tail probability \(1/26\).
Check Your Understanding
For each problem, assume the samples are independent and come from normal populations. Use the stated upper-tail alternative and give the decision at the specified significance level.
- Sample 1 is \(2,4,6\), and sample 2 is \(1,2,3\). Test \(H_1:\sigma_1^2>\sigma_2^2\) at \(\alpha=0.05\). Find the sample variances, statistic, degrees of freedom, and p-value. (Answer: \(s_1^2=4,\ s_2^2=1,\ F=4\) with \((2,2)\) degrees of freedom, \(p=0.2000\); do not reject.)
- Sample 1 is \(1,3,5\), and sample 2 is \(-2,-1,0,1,2\). Test at \(\alpha=0.10\). (Answer: \(s_1^2=4,\ s_2^2=2.5,\ F=1.6\) with \((2,4)\) degrees of freedom, \(p=(2/3.6)^2=25/81\approx0.3086\); do not reject.)
- Sample 1 is \(0,4,8\), and sample 2 is \(-2,-1,-1,0,1,1,2\). Test at \(\alpha=0.025\). (Answer: \(s_1^2=16,\ s_2^2=2,\ F=8\) with \((2,6)\) degrees of freedom, \(p=(3/11)^3=27/1331\approx0.0203\); reject.)
- Sample 1 is \(0,3,6\), and sample 2 is \(-2,-1,0,1,2\). Test the upper-tail claim \(\sigma_1^2/\sigma_2^2>2\) at \(\alpha=0.10\). (Answer: \(s_1^2=9,\ s_2^2=2.5\); use the adjusted statistic \(F=(9/2.5)/2=1.8\), with \((2,4)\) degrees of freedom. The p-value is \((2/3.8)^2\approx0.2770\); do not reject.)