F Test


F-test: Testing for difference between two sample variances

One of the requirements of adopting a parametric testing procedure for determining differences in a parameter of two or more samples is that the samples have equivalent variances (s²). Although any two sample variances are extremely unlikely to be identical, the usual approach is to determine whether there is any statistically significant difference at a given level of confidence or probability.

If it is found that two sample variances are significantly different then it is preferable to employ a non-parametric hypothesis test. In some cases it may be possible to transform the original sample data by calculating log values and this may reduce the inequality in variance of two samples.

The other frequent requirement of parametric testing methods is that the sample data follows a normal distribution.

Related tool:

Goodness of fit (x²) for normality: Detect normality using chi-square goodness of fit test.

Script operation

This tool operates in much the same way as most of the others with no specific departures from the usual methods needed.

Click here for information about general script usage.

Click **need to insert src for graphic here** for the formula used by this F-test.

Raw sample data is entered in two columns as shown. Note that this tool will also accept sample data with unequal sample sizes. Follow the worked example below to observe how summary statistics are computed for the two samples. Titles used for the raw data samples may be transferred and printed within the output by inclusion in the input range.

 Raw data:      	    Spreadsheet output:

 Sample I   Sample II       F-test:Two-sample for variances
       64          26   			Sample_I   Sample_II
       52          35       Count:      	       9	   9
       48          34       Mean:       	 50.2222	  31
       52          32       Variance:   	 49.6944       10.75
       43          34       d.f.(v):    	       8	   8
       44          28
       46          29       F Ratio:    	  4.6227
       58          28       P(F<=f) one-tail:   0.022173
       45          33       F-Critical (95%):     3.4381
			    F-Critical (99%):     6.0289
			    P(F<=f) two-tail:   0.044346
			    F-Critical (95%):     4.4333
			    F-Critical (99%):     7.4959

Interpretation

If a two-sample F-test is being conducted simply as a precursor to making a decision as to whether to embark on parametric testing procedures, then the null hypothesis is likely to take the following form:

HO: The variance of the 1st sample [s²(1)] is not significantly different from the variance of the 2nd sample [s²(2)].

As we are not interested in whether one variance is larger or smaller than the other but just whether significant difference exists, this can be defined as a two-tailed hypothesis test. Under all other circumstances of the F-test (i.e., ANOVA) the test is a one-tail variety.

In the example output above, it can be seen that at the 0.05 level of significance the F-critical value of 4.4333 is exceeded by the computed F-statistic of 4.6227 and that this therefore implies that the null hypothesis should be rejected. Note that in this particular case the null hypothesis would be retained at the much more stringent 0.01 level of significance.