Login
📚 Mostly Harmless Statistics
Chapters ▾
⇩ Download ▾

9.4 Two Variance or Standard Deviation F-Test

9.5.1 The F-Distribution

An F-distribution is another special type of distribution for a continuous random variable.

Properties of the F-distribution density curve:

The shape of the distribution curve changes when the degrees of freedom change. Figure 9-9 shows examples of F-distributions with different degrees of freedom.

Four overlaid F-distribution curves showing how the shape changes with degrees of freedom: df1 = 2, df2 = 27 in red decreases steadily, while df1 = 4, df2 = 7 in dark red, df1 = 14, df2 = 17 in magenta, and df1 = 24, df2 = 27 in blue form progressively taller right-skewed humps, all starting at zero.

Figure 9-9

We will use the F-distribution in several types of hypothesis testing. For now, we are just learning how to find the critical value and probability using the F-distribution.

Use the TI-89 Distribution menu; or in Excel F.INV to find the critical values for the F-distribution for tail areas only, depending on the degrees of freedom. When finding a probability given an F-score, use the calculator Fcdf function under the DISTR menu or in Excel use F.DIST. Note that the TI-83 and TI-84 do not come with the INVF function, but you may be able to find the program online or from your instructor.

Alternatively, use the calculator at https://homepage.divms.uiowa.edu/~mbognar/applets/f.html which will also graph the distribution for you and shade in one tail at a time. You will see the shape of the F-distribution change in the following examples depending on the degrees of freedom used. For your own sketch just make sure you have a positively skewed distribution starting at zero.

The critical values Fα/2 and F1–α/2 are for a two-tailed test on the F-distribution curve with area 1 – α between the critical values as shown in Figure 9-10. Note that the distribution starts at zero, is positively skewed, and never has negative F-scores.

F-distribution curve, starting at zero and positively skewed, with both tails shaded green: a left tail of area α/2 below the critical value F α/2 and a right tail of area α/2 above F 1-α/2, with the central area labeled 1 - α/2.

Figure 9-10

9.5.2 Hypothesis Test for Two Variances

Sometimes we will need to compare the variation or standard deviation between two groups. For example, let’s say that the average delivery time for two locations of the same company is the same but we hear complaint of inconsistent delivery times for one location. We can use an F-test to see if the standard deviations for the two locations was different.

There are three types of hypothesis tests for comparing the ratio of two population variances, see Figure 9-14.

Three-column table of hypothesis tests for two variances. Two-tailed: H0: σ1² = σ2², H1: σ1² ≠ σ2², with both tails of a right-skewed F curve shaded green. Right-tailed: H1: σ1² > σ2², right tail shaded. Left-tailed: H1: σ1² < σ2², left tail shaded. A bottom row restates each pair as ratios, such as H0: σ1²/σ2² = 1 versus H1: σ1²/σ2² > 1.

Figure 9-14

If we take the square root of the variance, we get a standard deviation. Therefore, taking the square root of both sides of the hypotheses, we can also use the same test for standard deviations. We use the following notation for the hypotheses.

There are 3 types of hypothesis tests for comparing the population standard deviations σ1/σ2, see Figure 9-15.

Three-column table of hypothesis tests for two standard deviations. Two-tailed: H0: σ1 = σ2, H1: σ1 ≠ σ2, with both tails of a right-skewed F curve shaded green. Right-tailed: H1: σ1 > σ2, right tail shaded. Left-tailed: H1: σ1 < σ2, left tail shaded.

Figure 9-15

Important: This F-test is not robust (a statistic is called “robust” if it still performs reasonably well even when the necessary conditions are not met). In particular, this F-test demands that both populations be normally distributed even for larger sample sizes. This F-test yields unreliable results when this condition is not met.

# "Not robust" has a price tag. Here it is.
# Both samples come from the SAME skewed population, so the variances really ARE
# equal: a 5% test should reject H0 about 5% of the time. Watch what happens.
set.seed(9)
n1 <- 20; n2 <- 18
rate <- function(gen) mean(replicate(5000, {
  x <- gen(n1); y <- gen(n2)
  Fstat <- var(x) / var(y)
  tail <- pf(Fstat, n1 - 1, n2 - 1)
  2 * min(tail, 1 - tail) < 0.05          # two-tailed, alpha = 0.05
}))
rate(rexp)    # skewed population -> about 0.26, five times the 5% you asked for
rate(rnorm)   # normal population -> back near 0.05, as advertised
# Change rexp to runif (light tails) to see the error rate miss the other way.

The traditional method (or critical value method), and the p-value method are performed with steps that are identical to those when performing hypothesis tests from previous sections.

Adapted from Mostly Harmless Statistics by Rachel Webb (Portland State University), hosted on LibreTexts (stats.libretexts.org) and licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.