<< Click to Display Table of Contents >> Navigation: Classical tests > Variance tests > F-tests of two variances |
In the previous section a test for a single variance was given which used the chi-squared distribution. When comparing the variances of two independent samples drawn from populations that are assumed to be Normal, the ratio of the sample variances are used. And this ratio, of two chi-squared variates, follows an F-distribution. This means that to compare two variances, essentially to determine if they can reasonably be regarded as being drawn from populations with the same variance, the following ratio is computed:
and the F-value is compared to the percentage points of the F-distribution.
Example 1: Tensile strength testing
In the table below the tensile strength of six specimens from two batches of rubber are shown. In the last line of the table the variances of each set is provided. The ratio of the larger variance to the smaller is 3.33. If we compare this value to the upper 2.5% point of the F-distribution we find the critical value is 7.15, so there is no evidence on the basis of this comparison that variation of the two batches are significantly different.
If, as is actually the case with this data, there were more batches, each pair could be compared separately, or simply the largest sample variance could be compared with the smallest, providing a quick check on the homogeneity of the variance of all the samples. More generally a test specifically designed for checking variance homogeneity is recommended.
Tensile strength of specimens of rubber (after Pearson and Hartley, 1954, p38 [PEA1])
Specimen |
Batch 2 |
Batch 4 |
1 |
116 |
181 |
2 |
179 |
190 |
3 |
182 |
210 |
4 |
143 |
173 |
5 |
156 |
172 |
6 |
174 |
187 |
Variance |
653.07 |
196.30 |
Example 2: Insect wing span data
This example uses the wings.txt sample data described earlier, from Crawley (2007, [CRA1]). The data represents the wings span in mm of two groups of insects, A and B, of the same species but in different locations (see also, Kolmogorov-Smirnov test discussion, Example 2b). The means of these two datasets are approximately equal, but the equality of variances can be computed immediately using the var.test() function in R (an F test), with the results being shown below:
F test to compare two variances. Data: A and B
F = 0.5014, num df = 49, denom df = 69, p-value = 0.01192
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval: 0.3006728 0.8559914
The test thus identifies that the two sample are significantly different, with sample B having wing spans which vary twice as much as those for sample A.
A different kind of paired variance test is very commonly applied when comparing the pattern of variance within groups, to that between groups. This uses exactly the same procedure as above, but is examining whether differences between batches are more significant than variation within batches, and this is known as an analysis of variance, or ANOVA procedure (see further, Analysis of variance and covariance topic).
References
[CRA1] Crawley M J (2007) The R Book. J Wiley & Son, Chichester, UK, 2nd ed 2015
[PEA1] Pearson E S, Hartley H O eds. (1954) Biometrika Tables for Statisticians. 4th edition. Vol. 1, Cambridge University Press, Cambridge, UK