The F Test for Equal Variances

What is an F test?

An F test is a statistical hypothesis test that can be used to evaluate whether the variances of two groups or populations differ from one another.

How are F tests used?

First, define the hypothesis you are going to test and specify an acceptable risk of drawing a faulty conclusion. Next, calculate a test statistic from your data and compare it to a theoretical value from an F distribution. Depending on the outcome, either reject or fail to reject your null hypothesis. For example, you can use an F test to test the variances of two groups in a two-samplet-test to evaluate the homogeneity of variances (equal variance) assumption

What are the F test assumptions?

The assumptions of an F test for equal variances are:

These assumptions ensure that the numerator and denominator of the F statistic both have Chi-square ($\chi$2) distributions. The ratio of two $\chi$2 random variables has an F distribution.

How do you perform the F test?

The null and alternative hypotheses are:

$H_0: \sigma_1^2 = \sigma_2^2$

$H_1: \sigma_1^2 \neq \sigma_2^2 $

After you collect data, summarize the data by calculating the sample variances. The F statistic is:

$F = \frac{s_1^2}{s_2^2} $

where the larger sample variance is in the numerator and the smaller sample variance is in the denominator. Sample sizes for each sample are denoted as n1 and n2.

Under the null hypothesis (that is, if the population variances are equal), the F ratio follows an $ F(n_1 - 1, n_2 - 1) $ distribution, where n1-1 and n2-1 are the numerator and denominator degrees of freedom (df) respectively. Therefore, reject H0 if $ F > F(1 - \alpha, n_1 - 1, n_2 - 1) $ where $\alpha$ is the level of significance of the test.

Example of an F test?

Let’s use the same data in the two-samplet-test example to test the hypothesis that men and women have the same body fat percentage variances.

Recall that our sample data are from a group of men and women who did workouts at a gym three times per week for one year. At the end of the year, their trainer measured their body fat percentage. The table below shows the data of the body fat percentages, grouped by gender.

Group Body Fat Percentages
Men 13.3 6.0 20.0 8.0 14.0
19.0 18.0 25.0 16.0 24.0
15.0 1.0 15.0
Women 22.0 16.0 21.7 21.0 30.0
26.0 12.0 23.2 28.0 23.0

The assumptions of the F test correspond to the assumptions of the two samplet-test and were verified.

To perform the F test, follow the steps for hypothesis testing.

  1. State the null and alternative hypotheses. The null hypothesis contains the less than or equal to sign instead of just the equal sign because we will perform the test by dividing the larger sample variance by the smaller sample variance. Thus, we can perform a one-sided F test.
    $ H_0 : \sigma_1^2 \leq \sigma_2^2$
    $ H_0 : \sigma_1^2 > \sigma_2^2 $
  2. Decide on the risk we are willing to take for declaring that a difference is significant when it is not. For the body fat data, we decide we are willing to take a 1% risk of saying that the unknown variances are not equal when they really are. The significance level of the test a is set to 0.01.
  3. Calculate the F ratio. The test statistic is:
    $F = \frac{s_1^2}{s_2^2} = \frac{6.84^2}{5.32^2} = 1.65$.
  4. Perform the test. The reference distribution is:
    $ F(n_1 - 1, n_2 - 1) = F(12,9)$

The F value with $\alpha$ = 0.01 and 12 numerator df and 9 denominator df is 5.11. Since 1.65 > 5.11, we fail to reject the null hypothesis of equal variances. We conclude that the variances are equal and that the equal variance assumption of the two-sample t-test is valid.