Search

Search papers and lessons

F-Distribution

Level 3 · 11 min read

The F-distribution is the law of a ratio of two independent scaled chi-squared variables; it describes how much one variance estimate can exceed another by chance.

On this page

  • Colour = topic mix
  • Probability
  • Discrete math
  • Calculus
  • ReadReady to readNot yet

TL;DR

The F-distribution describes the ratio of two independent variance estimates, each made from noise and each divided by its degrees of freedom. It is always positive and has a long right tail, and its shape is set by two numbers, the degrees of freedom of the top and bottom estimates. It is the reference curve for asking whether one variance is larger than another by more than chance can explain.

Builds on: Chi-Squared Distribution, independence · Leads to: the F-test for comparing nested models, and analysis of variance

Where it's used

Comparing several group means (analysis of variance). A nutrition study gives three diets to three groups of plants, five plants each. The spread between the group averages is compared with the spread within the groups. Their ratio, the F-statistic, follows an F-distribution when the diets have no effect. A large ratio is unlikely under that assumption, so the diets probably differ.

The overall test in a regression. A regression with several predictors asks whether the predictors together explain anything at all. The drop in residual error from adding them is divided by the leftover error, and the result is compared with an F-distribution. This is the F-Test applied to nested models.

Comparing two variances. A factory checks whether two machines fill bottles with the same consistency. It takes a sample from each machine and divides one sample variance by the other. Under equal true variances, that ratio follows an F-distribution with the two sample sizes minus one as its degrees of freedom. A ratio far from 1 is evidence that one machine is less consistent.

How it works

Use the simplest version. Take two groups of standard Gaussian noise, which means numbers with mean 0 and variance 1, drawn independently. The numerator group has d1=2d_1 = 2 numbers. The denominator group has d2=3d_2 = 3 numbers.

  1. Build the numerator. Draw two numbers from the numerator group: 11 and −1-1. Square them and add: U=12+(−1)2=2U = 1^2 + (-1)^2 = 2. This is a chi-squared variable with 2 degrees of freedom. Divide by its degrees of freedom: U/d1=2/2=1U/d_1 = 2/2 = 1. Check: each square is at least zero, so UU is never negative.

  2. Build the denominator. Draw three numbers from the denominator group: 11, 22 and 00. Square and add: V=1+4+0=5V = 1 + 4 + 0 = 5. Divide by its degrees of freedom: V/d2=5/3≈1.667V/d_2 = 5/3 \approx 1.667. Check: VV is also a sum of squares, so it is a chi-squared variable with 3 degrees of freedom.

  3. Take the ratio. F=(U/d1)/(V/d2)=1/1.667=0.6F = (U/d_1)/(V/d_2) = 1 / 1.667 = 0.6. The numerator group happened to look smaller than the denominator group in this draw. Check: FF is a ratio of two positive numbers, so it is positive.

  4. Draw again. New numbers for the numerator, 22 and 22, give U=8U = 8 and U/d1=4U/d_1 = 4. New denominator numbers 0.50.5, 0.50.5 and 0.50.5 give V=0.75V = 0.75 and V/d2=0.25V/d_2 = 0.25. Now F=4/0.25=16F = 4/0.25 = 16. A value that large is rare, but it can occur. Check: the denominator is small here, which is what pushes the ratio far above 1.

  5. Repeat many times. Each draw gives one value of FF. Thousands of draws give a histogram. Its shape is the F-distribution with d1=2d_1 = 2 and d2=3d_2 = 3. The values pile up near small numbers and have a long tail to the right. Check: the smallest possible value is 0 and there is no largest value, but large values become rarer.

The plot below shows the curve for d1=5d_1 = 5 and d2=10d_2 = 10. Its peak is at 0.50.5, and the tail continues to the right.

01234500.20.40.60.8Fdensity
  • F with 5 and 10 degrees of freedom
The F-distribution with 5 and 10 degrees of freedom. It starts at zero, peaks at 0.5, and has a long right tail; the marked point is the peak height.

The math

Definition

Definition: F-distribution

Let U∼χ2(d1)U \sim \chi^2(d_1) and V∼χ2(d2)V \sim \chi^2(d_2) be independent. The ratio F=(U/d1)/(V/d2)F = (U/d_1)/(V/d_2) has an F-distribution with d1d_1 and d2d_2 degrees of freedom, written F(d1,d2)F(d_1, d_2). For x>0x > 0 its density is

f(x)=1B(d12,d22)(d1d2)d1/2xd1/2−1(1+d1xd2)−(d1+d2)/2,f(x) = \frac{1}{B\left(\frac{d_1}{2}, \frac{d_2}{2}\right)} \left(\frac{d_1}{d_2}\right)^{d_1/2} x^{d_1/2 - 1} \left(1 + \frac{d_1 x}{d_2}\right)^{-(d_1 + d_2)/2},

where B(a,b)=Γ(a)Γ(b)/Γ(a+b)B(a, b) = \Gamma(a)\Gamma(b)/\Gamma(a+b) is the beta function built from the gamma function Γ\Gamma.

Here "degrees of freedom" means the number of independent squared standard Gaussians added to form each chi-squared variable. Since the variables are sums of squares, the ratio is never negative.

Step 1 in symbols: the ratio

With the walkthrough's numbers, U=2U = 2, d1=2d_1 = 2, V=5V = 5, d2=3d_2 = 3, the ratio is

F=U/d1V/d2=d2 Ud1 V=3⋅22⋅5=0.6.F = \frac{U/d_1}{V/d_2} = \frac{d_2\,U}{d_1\,V} = \frac{3 \cdot 2}{2 \cdot 5} = 0.6.

Check: 3⋅2=63 \cdot 2 = 6 and 2⋅5=102 \cdot 5 = 10, and 6/10=0.66/10 = 0.6.

Step 2 in symbols: why the density has this form

The density of UU alone is a gamma-type curve, and the same holds for VV. Forming the ratio of two independent variables and changing variables in the integral gives the expression in the definition. The normalising constant B(d1/2,d2/2)B(d_1/2, d_2/2) is there so that the total area under the curve is 1. The full derivation is standard, and this lesson states the result rather than repeating it.

Check: for d1=5d_1 = 5 and d2=10d_2 = 10, the constant is B(2.5,5)≈0.01705B(2.5, 5) \approx 0.01705, and the density at x=0.5x = 0.5 is about 0.6880.688, the height of the marked point in the plot.

Step 3 in symbols: mean and mode

Two summaries describe where the curve sits:

E[F]=d2d2−2(d2>2),mode=d2(d1−2)d1(d2+2)(d1>2).\mathbb{E}[F] = \frac{d_2}{d_2 - 2} \quad (d_2 > 2), \qquad \text{mode} = \frac{d_2(d_1 - 2)}{d_1(d_2 + 2)} \quad (d_1 > 2).

For d1=5d_1 = 5 and d2=10d_2 = 10, the mean is 10/8=1.2510/8 = 1.25 and the mode is 10⋅3/(5⋅12)=0.510 \cdot 3 / (5 \cdot 12) = 0.5. The mean is larger than the mode because of the right tail.

Check: 10/8=1.2510/8 = 1.25 and 30/60=0.530/60 = 0.5, the two values used in the worked example below.

Step 4 in symbols: swapping the roles

Interchanging the numerator and denominator groups gives the reciprocal:

if F∼F(d1,d2), then 1F∼F(d2,d1).\text{if } F \sim F(d_1, d_2), \text{ then } \frac{1}{F} \sim F(d_2, d_1).

This is why the order of the degrees of freedom matters. Writing F(5,10)F(5, 10) and F(10,5)F(10, 5) describes different curves, and the reader must check which estimate is on top.

Worked examples

Example
1. Two variance estimates that agree

A numerator estimate uses d1=3d_1 = 3 degrees of freedom and has sum of squares U=6U = 6. A denominator estimate uses d2=4d_2 = 4 degrees of freedom and has V=8V = 8. Find FF.

  1. Compute the numerator average: U/d1=6/3=2U/d_1 = 6/3 = 2.
  2. Compute the denominator average: V/d2=8/4=2V/d_2 = 8/4 = 2.
  3. Take the ratio: F=2/2=1F = 2 / 2 = 1.
  4. Check: the two averages are equal, so their ratio is 1.
  5. Interpretation: when the two estimates agree, FF sits at 1. Values much bigger than 1 suggest the numerator is larger than chance would give.
Example
2. The mean and mode of F(5, 10)

Find the mean and the mode of the F-distribution with d1=5d_1 = 5 and d2=10d_2 = 10.

  1. The mean needs d2>2d_2 > 2, which holds. Compute d2−2=8d_2 - 2 = 8.
  2. The mean is d2/(d2−2)=10/8=1.25d_2 / (d_2 - 2) = 10 / 8 = 1.25.
  3. Check: 10/8=1.2510 / 8 = 1.25, which is larger than the mode, as expected for a right-skewed curve.
  4. The mode needs d1>2d_1 > 2, which holds. Compute d1−2=3d_1 - 2 = 3 and d2+2=12d_2 + 2 = 12.
  5. The mode is d2(d1−2)/(d1(d2+2))=10⋅3/(5⋅12)=30/60=0.5d_2(d_1 - 2) / (d_1(d_2 + 2)) = 10 \cdot 3 / (5 \cdot 12) = 30 / 60 = 0.5.
  6. Interpretation: the typical value sits near 0.50.5, but the mean is 1.251.25. The long right tail pulls the average up.
Example
3. Comparing three diets

A study gives three diets to three groups of plants, with 55 plants per group. The between-group mean square is 12.012.0, and the within-group mean square is 4.04.0. The degrees of freedom are d1=k−1=2d_1 = k - 1 = 2 for the between-group estimate and d2=N−k=15−3=12d_2 = N - k = 15 - 3 = 12 for the within-group estimate. Find the F-statistic and say what it tests.

  1. Count the groups k=3k = 3 and the total plants N=15N = 15.
  2. Compute d1=k−1=2d_1 = k - 1 = 2 and d2=N−k=12d_2 = N - k = 12.
  3. Compute the F-statistic: F=12.0/4.0=3.0F = 12.0 / 4.0 = 3.0.
  4. Compare with the F-distribution F(2,12)F(2, 12) under the Null Hypothesis that the three diets have the same effect. A standard F-table gives a 5 percent critical value of about 3.893.89 for this distribution.
  5. Check the decision: 3.03.0 is below 3.893.89, so the P-Value is above 0.050.05 and the data do not show a difference at that level.
  6. Interpretation: the spread between the diet groups is about three times the spread within them, which chance alone could plausibly produce. More plants would be needed to tell the diets apart.

Try it: four groups of 66 plants each, with between-group mean square 9.09.0 and within-group mean square 3.03.0. Find d1d_1, d2d_2 and FF. Answer: d1=4−1=3d_1 = 4 - 1 = 3, d2=24−4=20d_2 = 24 - 4 = 20, and F=9.0/3.0=3.0F = 9.0 / 3.0 = 3.0, so the statistic is 3.03.0 on F(3,20)F(3, 20).

Common mistakes and tradeoffs

Mistake 1: "FF is just a ratio of two sums of squares." It is tempting to divide the raw sums and compare with 1. In fact each sum must first be divided by its degrees of freedom. Without that step the ratio is not F-distributed, and a sum from a bigger group is always larger, which tells you nothing. The division puts the two estimates on a common scale.

Mistake 2: "An F-value above 1 means the effect is real." It is tempting to read F>1F > 1 as significant. In fact values near 1 are what you expect when nothing differs, and the threshold depends on both degrees of freedom and the chosen level. Use the critical value from the F-distribution, or its P-Value, to decide.

Mistake 3: "The order of the degrees of freedom does not matter." It is tempting to swap them when reading a table. In fact F(d1,d2)F(d_1, d_2) and F(d2,d1)F(d_2, d_1) are different curves, although 1/F1/F has the other distribution. Put the numerator degrees of freedom first.

When to use it. Use the F-distribution when comparing variances or nested models from independent samples that are close to normal, and when a sum of squares is divided by its degrees of freedom. The one-sample and two-sample means use the Student's t-Distribution instead. The F-test is equivalent to the t-test when comparing exactly two means.

When not to use it. The F-distribution assumes normal noise and independent observations. With strongly skewed data, or data where observations are linked (repeated measurements of the same person), the F-reference can be wrong. A Permutation Test or a model that matches the design is a safer alternative.

History

Ronald Fisher developed the idea of comparing variance estimates in the 1920s, and he worked with a transformed version of the ratio. George W. Snedecor later worked with the statistic itself, named it F in Fisher's honour, and published tables of its critical values. The F-distribution caught on because one test could cover a whole block of terms in an experiment or a regression, and it became the central tool of analysis of variance.

Recap

  • An F-variable is the ratio (U/d1)/(V/d2)(U/d_1)/(V/d_2) of two independent chi-squared variables, each divided by its degrees of freedom.
  • Its density has a gamma-type normalising constant and a right-skewed shape set by d1d_1 and d2d_2.
  • The mean is d2/(d2−2)d_2/(d_2 - 2) and the mode is d2(d1−2)/(d1(d2+2))d_2(d_1 - 2)/(d_1(d_2 + 2)) when those are defined.
  • Swapping the roles of the two degrees of freedom gives the reciprocal, 1/F(d1,d2)∼F(d2,d1)1/F(d_1, d_2) \sim F(d_2, d_1).
  • It is the reference curve for F-tests in regression and for comparing several group means.

Read next: the F-Test, which applies this curve to nested models, and the Student's t-Distribution, which is the same idea for a single mean.

Check yourself

QuestionWrite the F-statistic in terms of two independent chi-squared variables U and V, and say what d_1 and d_2 count.Show answer

F=(U/d1)/(V/d2)F = (U/d_1)/(V/d_2), where U∼χ2(d1)U \sim \chi^2(d_1) and V∼χ2(d2)V \sim \chi^2(d_2). The degrees of freedom d1d_1 and d2d_2 count the independent squared standard Gaussians that add up to UU and VV.

QuestionA numerator has d1=4d_1 = 4 and U=12U = 12. A denominator has d2=5d_2 = 5 and V=10V = 10. Find FF.Show answer

The numerator average is U/d1=12/4=3U/d_1 = 12/4 = 3. The denominator average is V/d2=10/5=2V/d_2 = 10/5 = 2. So F=3/2=1.5F = 3/2 = 1.5.

QuestionWhy can an F-statistic never be negative, and why is the distribution skewed to the right?Show answer

Both UU and VV are sums of squares, so they are never negative, and their ratio is never negative. The distribution is skewed because the ratio cannot go below zero, while a denominator near zero can make it arbitrarily large.

QuestionA one-way analysis of variance has k=4k = 4 groups and N=20N = 20 observations in total. Which F-distribution applies, and what are its degrees of freedom?Show answer

The numerator degrees of freedom are k−1=3k - 1 = 3 and the denominator degrees of freedom are N−k=16N - k = 16. The applicable distribution is F(3,16)F(3, 16).

Sources