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 numbers. The denominator group has numbers.
-
Build the numerator. Draw two numbers from the numerator group: and . Square them and add: . This is a chi-squared variable with 2 degrees of freedom. Divide by its degrees of freedom: . Check: each square is at least zero, so is never negative.
-
Build the denominator. Draw three numbers from the denominator group: , and . Square and add: . Divide by its degrees of freedom: . Check: is also a sum of squares, so it is a chi-squared variable with 3 degrees of freedom.
-
Take the ratio. . The numerator group happened to look smaller than the denominator group in this draw. Check: is a ratio of two positive numbers, so it is positive.
-
Draw again. New numbers for the numerator, and , give and . New denominator numbers , and give and . Now . 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.
-
Repeat many times. Each draw gives one value of . Thousands of draws give a histogram. Its shape is the F-distribution with and . 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 and . Its peak is at , and the tail continues to the right.
- F with 5 and 10 degrees of freedom
The math
Definition
Let and be independent. The ratio has an F-distribution with and degrees of freedom, written . For its density is
where is the beta function built from the gamma function .
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, , , , , the ratio is
Check: and , and .
Step 2 in symbols: why the density has this form
The density of alone is a gamma-type curve, and the same holds for . Forming the ratio of two independent variables and changing variables in the integral gives the expression in the definition. The normalising constant 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 and , the constant is , and the density at is about , the height of the marked point in the plot.
Step 3 in symbols: mean and mode
Two summaries describe where the curve sits:
For and , the mean is and the mode is . The mean is larger than the mode because of the right tail.
Check: and , 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:
This is why the order of the degrees of freedom matters. Writing and describes different curves, and the reader must check which estimate is on top.
Worked examples
A numerator estimate uses degrees of freedom and has sum of squares . A denominator estimate uses degrees of freedom and has . Find .
- Compute the numerator average: .
- Compute the denominator average: .
- Take the ratio: .
- Check: the two averages are equal, so their ratio is 1.
- Interpretation: when the two estimates agree, sits at 1. Values much bigger than 1 suggest the numerator is larger than chance would give.
Find the mean and the mode of the F-distribution with and .
- The mean needs , which holds. Compute .
- The mean is .
- Check: , which is larger than the mode, as expected for a right-skewed curve.
- The mode needs , which holds. Compute and .
- The mode is .
- Interpretation: the typical value sits near , but the mean is . The long right tail pulls the average up.
A study gives three diets to three groups of plants, with plants per group. The between-group mean square is , and the within-group mean square is . The degrees of freedom are for the between-group estimate and for the within-group estimate. Find the F-statistic and say what it tests.
- Count the groups and the total plants .
- Compute and .
- Compute the F-statistic: .
- Compare with the F-distribution under the Null Hypothesis that the three diets have the same effect. A standard F-table gives a 5 percent critical value of about for this distribution.
- Check the decision: is below , so the P-Value is above and the data do not show a difference at that level.
- 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 plants each, with between-group mean square and within-group mean square . Find , and . Answer: , , and , so the statistic is on .
Common mistakes and tradeoffs
Mistake 1: " 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 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 and are different curves, although 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 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 and .
- The mean is and the mode is when those are defined.
- Swapping the roles of the two degrees of freedom gives the reciprocal, .
- 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
, where and . The degrees of freedom and count the independent squared standard Gaussians that add up to and .
QuestionA numerator has and . A denominator has and . Find .Show answer
The numerator average is . The denominator average is . So .
QuestionWhy can an F-statistic never be negative, and why is the distribution skewed to the right?Show answer
Both and 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 groups and observations in total. Which F-distribution applies, and what are its degrees of freedom?Show answer
The numerator degrees of freedom are and the denominator degrees of freedom are . The applicable distribution is .