F distribution
F distribution: the ratio of two variances. With the default parameters (numerator df d₁ = 5, denominator df d₂ = 10) its mean is 1.25 and its standard deviation 1.1637. Use the simulator below to draw samples and see it take shape.
Simulate it
Change the parameters, then draw random samples. The bars are the samples; the line is the exact density. With more samples the bars settle onto it.
Samples to draw
What is the F distribution?
The F distribution is the distribution of the ratio of two independent chi-square variables, each divided by its degrees of freedom. It has two parameters, the numerator and denominator degrees of freedom, and it describes how a ratio of two sample variances behaves when the true variances are equal.
It is the reference distribution for ANOVA (comparing several group means), for the test that two variances are equal, and for the overall significance test of a regression model.
Where it is used
- One-way and two-way ANOVA: do the group means differ?
- Test that two population variances are equal.
- Overall F-test in linear regression.
- Comparing nested models.
Shape and parameters
Positive and right-skewed. The mean is close to 1 for large denominator degrees of freedom (exactly d₂/(d₂ − 2) for d₂ > 2), and the variance exists only for d₂ > 4. A large F means the variation between groups is large compared with the variation within them.
What it assumes
- Independent observations.
- Approximately normal data within groups.
- For ANOVA, equal variances across groups.
How it relates to other distributions
- Chi-square distribution: An F is a ratio of two scaled chi-squares.
- Student's t distribution: T² with ν df is F(1, ν).
Common mistakes
- Swapping the numerator and denominator degrees of freedom, which changes the critical value.
- Using the F-test for equal variances on data that are not close to normal, where it is very sensitive.
How to work it out
- 1
The probability density function (the formula that gives the shape):
- 2
Its mean (the long-run average) and variance (the spread):
- 3
Worked example with the default parameters (numerator df d₁ = 5, denominator df d₂ = 10): With 5 and 10 degrees of freedom, what is the probability of a value above 3.33?
LaTeX source of the formulas on this page
\[ f(x)=\frac{1}{x\,B\!\left(\frac{d_1}{2},\frac{d_2}{2}\right)}\sqrt{\frac{(d_1x)^{d_1}d_2^{d_2}}{(d_1x+d_2)^{d_1+d_2}}} \]
\[ \mu = \frac{d_2}{d_2-2}\ (d_2>2),\qquad \sigma^2 = \frac{2d_2^2(d_1+d_2-2)}{d_1(d_2-2)^2(d_2-4)}\ (d_2>4) \]
\[ \text{answer} = 0.0498 \]At a glance
| Property | Value |
|---|---|
| Type | Continuous (measurements) |
| Parameters | numerator df d₁; denominator df d₂ |
| Possible values | 0 to ∞ |
| Mean | 1.25 |
| Variance | 1.3542 |
| Standard deviation | 1.1637 |
| Example (numerator df d₁ = 5, denominator df d₂ = 10) | With 5 and 10 degrees of freedom, what is the probability of a value above 3.33? Answer: 0.0498. |
How to compute it in Excel, Python and R
| Tool | Function |
|---|---|
| Excel / Google Sheets | =F.DIST(x, d1, d2, TRUE) (F.DIST.RT for the p-value) |
| Python (SciPy) | scipy.stats.f.cdf(x, d1, d2) (sf for the p-value) |
| R | pf(x, d1, d2) (lower.tail = FALSE for the p-value) |
Questions
What is the F distribution used for?
The ratio of two variances. Typical uses: One-way and two-way ANOVA: do the group means differ? Test that two population variances are equal. Overall F-test in linear regression.
What are the mean and variance of the F distribution?
Mean: μ = (d_2)/(d_2-2)\ (d_2>2). Variance: σ² = (2d_2²(d_1+d_2-2))/(d_1(d_2-2)²(d_2-4))\ (d_2>4).
What does the F distribution assume?
Independent observations. Approximately normal data within groups. For ANOVA, equal variances across groups.
How do I calculate it in Excel?
=F.DIST(x, d1, d2, TRUE) (F.DIST.RT for the p-value)
How is the F distribution related to other distributions?
Chi-square distribution: An F is a ratio of two scaled chi-squares. Student's t distribution: T² with ν df is F(1, ν).