Calculator
Enter the sample variances and sample sizes of the two groups. The calculator computes the F statistic, the p-value, the critical values and the decision at the chosen significance level.
Explanation
Snedecor's F-test is the classic procedure for testing whether two independent populations show the same variability. Instead of comparing averages, this test evaluates whether the dispersion of one group is significantly greater or smaller than that of the other.
The method is common in quality control, comparative studies, and as a preliminary step to other tests: for example, the choice between Student's t-test with equal variances or with unequal variances depends on whether homoscedasticity can be assumed, which is precisely what this test evaluates.
The F statistic is built as the ratio between the two sample variances. Under the null hypothesis of equal variances, this ratio follows an F distribution with \(n_1 - 1\) and \(n_2 - 1\) degrees of freedom. If the variances are very different, the ratio will move away from 1 and the test will be significant.
The fundamental assumption is normality of the data in both groups. The F-test is sensitive to this condition; when normality is in doubt it is advisable to consider more robust alternatives such as Levene's test.
Hypotheses and statistic
The test states as the null hypothesis the equality of population variances:
\(H_0\colon \sigma_1^2 = \sigma_2^2\)
The alternative hypothesis depends on the type of test chosen:
- Two-tailed: \(H_1\colon \sigma_1^2 \neq \sigma_2^2\)
- Right tail: \(H_1\colon \sigma_1^2 > \sigma_2^2\)
- Left tail: \(H_1\colon \sigma_1^2 < \sigma_2^2\)
The test statistic is the ratio of the sample variances:
\( F = \dfrac{s_1^2}{s_2^2} \)
Under \(H_0\), this statistic follows an F distribution with degrees of freedom \(df_1 = n_1 - 1\) and \(df_2 = n_2 - 1\):
\( F = \dfrac{s_1^2}{s_2^2} \sim F_{n_1-1,\; n_2-1} \)
\(H_0\) is rejected when the F statistic falls in the critical region determined by the significance level \(\alpha\) and the selected test type.
Quick check
A first read of the F statistic gives a hint of the result before looking at the p-value:
- F close to 1: the sample variances are similar. Unless the samples are very large, it is likely that there is no evidence to reject \(H_0\).
- F clearly greater than 1: group 1 shows greater variability than group 2. The further it moves away from 1, the more evidence in favor of \(\sigma_1^2 > \sigma_2^2\).
- F clearly less than 1: group 2 shows greater variability than group 1. A value very close to 0 indicates strong evidence of \(\sigma_1^2 < \sigma_2^2\).
In any case, the formal decision should be based on the p-value and the significance level \(\alpha\), not just on the magnitude of F.
If the result is significant, it is worth investigating the source of the difference in variability: different processes, instruments, measurement conditions, batches or human groups may explain the observed disparity.
Worked example
We want to compare the variability of two production lines of metal parts. Line 1: sample variance \(s_1^2 = 16\) mm², sample size \(n_1 = 20\) parts. Line 2: sample variance \(s_2^2 = 9\) mm², sample size \(n_2 = 18\) parts. We test \(H_0\colon \sigma_1^2 = \sigma_2^2\) against \(H_1\colon \sigma_1^2 \neq \sigma_2^2\) with \(\alpha = 0.05\), two-tailed.
Step 1 — F statistic
\( F = \dfrac{s_1^2}{s_2^2} = \dfrac{16}{9} \approx 1.7778 \)
Step 2 — Degrees of freedom
\( df_1 = n_1 - 1 = 19, \quad df_2 = n_2 - 1 = 17 \)
Step 3 — Critical values (α = 0.05, two-tailed)
The upper critical value is \(F_{0.025;\,19,\,17} \approx 2.63\). The lower critical value is \(F_{0.975;\,19,\,17} = 1 / F_{0.025;\,17,\,19} \approx 0.38\).
Step 4 — Decision
Since \(0.38 < F = 1.7778 < 2.63\), the statistic does not fall in either rejection region. The two-tailed p-value is \(p \approx 0.24 > 0.05\).
Conclusion: \(H_0\) is not rejected. The data do not provide significant evidence that the two lines have different variances at the 5% significance level. The observed variabilities are compatible with the hypothesis of equality.
How to interpret the result
Rejecting \(H_0\) (p-value < \(\alpha\)) indicates that the ratio of sample variances \(F = s^2_1 / s^2_2\) is statistically incompatible with the population equality \(\sigma^2_1 = \sigma^2_2\). In practice this is relevant, for example, when deciding which variant of the t-test to use (equal or unequal variances) or when the homogeneity of variances is an assumption of ANOVA. However, Snedecor's F-test is very sensitive to deviations from normality: a significant result may be due to skewed tails rather than genuinely different variances. Before acting, inspect the data visually.
Not rejecting \(H_0\) (p-value ≥ \(\alpha\)) does not prove homoscedasticity; it only indicates that the data are compatible with \(\sigma^2_1 = \sigma^2_2\) at the chosen level. The F-test has low power with small samples, so it may not detect real differences in variance. The observed \(F\) ratio and its confidence interval provide information about the relative magnitude of the variabilities.
The F statistic follows, under \(H_0\), an F distribution with \((n_1-1, n_2-1)\) degrees of freedom. In the chart, the green zone is the non-rejection region and the red zones are the critical tails; the amber line marks the observed statistic. Since \(F \geq 0\), the distribution is right-skewed: an \(F \gg 1\) suggests greater variance in group 1, while \(F \ll 1\) suggests greater variance in group 2. With very large samples, moderate differences in variances can turn out significant even though they have little practical impact.
Frequently asked questions
- What fundamental assumption does the F-test require? The F-test assumes that the data in both groups come from normally distributed populations. It is sensitive to deviations from normality, so when this assumption is in doubt it is advisable to consider robust alternatives such as Levene's test or Bartlett's test.
- Does it matter which variance goes in the numerator? In a two-tailed test it does not matter, since the p-value is calculated taking both tails into account. In one-tailed tests it does matter: if you want to test that \(\sigma_1^2 > \sigma_2^2\), you must place group 1's variance in the numerator and use the right tail.
- When should the F-test be used instead of Levene's test? The F-test is appropriate when the data can be assumed normal. Levene's test is more robust against deviations from normality and is recommended when this condition cannot be verified. For small samples with confirmed normality, the F-test is the classic choice.
- Can the F-test be applied to more than two groups? Not directly. The F-test for equality of variances compares exactly two groups. To compare the homogeneity of variances across more than two groups, tests such as Bartlett's test or the generalized Levene's test are used, designed for the case of k groups.
Reference: F-test of equality of variances — Wikipedia