# How do I run a one-way ANOVA?

Runs a one-way ANOVA on 2 to 6 groups of numbers: the sums of squares, degrees of freedom, mean squares, F statistic, p-value and the critical F at your significance level.

- Page: https://www.acalculator.org/statistics/anova-calculator
- JSON spec: https://www.acalculator.org/statistics/anova-calculator.json
- Version: 4b0c346655a3

## Default answer

Example with the default inputs (Group 1 [6.9, 5.4, 5.8, 4.6, 4], Group 2 [8.3, 6.8, 7.8, 9.2, 6.5], Group 3 [8, 10.5, 8.1, 6.9, 9.3], Significance level (α) 5%): F(2, 12) = 9.59111, p = 0.00324822.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| g1 | Group 1 | The values of group 1, separated by commas, spaces, semicolons, or new lines. |
| g2 | Group 2 | The values of group 2, separated by commas, spaces, semicolons, or new lines. |
| g3 | Group 3 | The values of group 3, if there is one. Leave it empty to use fewer groups. |
| g4 | Group 4 | The values of group 4, if there is one. Leave it empty to use fewer groups. |
| g5 | Group 5 | The values of group 5, if there is one. Leave it empty to use fewer groups. |
| g6 | Group 6 | The values of group 6, if there is one. Leave it empty to use fewer groups. |
| alpha | Significance level (α) | The chance of rejecting equal means when they are equal; 5% is common. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| f | F statistic | MST ÷ MSE: the variation between group means over the variation within groups. |
| p | p-value | The chance of an F this large or larger when all group means are equal. |
| decision | Decision | Whether the p-value is below α: reject or do not reject equal means. |
| critical | Critical F | The F value with an upper-tail area of α, for k − 1 and N − k degrees of freedom. |
| ssb | Sum of squares between (SST) | Σ nᵢ (x̄ᵢ − x̄)², the treatment sum of squares. |
| ssw | Sum of squares within (SSE) | Σ (x − x̄ᵢ)² over every value, the error sum of squares. |
| sst | Total sum of squares | SST + SSE = Σ (x − x̄)². |
| dfb | df between | k − 1, for k groups. |
| dfw | df within | N − k, for N values in all. |
| msb | Mean square between (MST) | SST ÷ (k − 1). |
| msw | Mean square within (MSE) | SSE ÷ (N − k). |
| means | Group means | The mean of each group, to 6 significant digits. |
| grand | Grand mean | The mean of all N values. |
| k | Groups (k) | How many groups have values. |
| n | Values (N) | How many values there are in all. |

## Method

F = [SST ÷ (k − 1)] ÷ [SSE ÷ (N − k)]; p = P(F(k − 1, N − k) ≥ F).

## Assumptions

- The groups are independent random samples from normal populations with the same variance.
- Empty groups are left out; ANOVA needs at least 2 groups and more values than groups.
- The test asks whether all group means are equal; it does not say which ones differ.

## Worked examples

1. g1 = 6.9 or 5.4, g2 = 8.3 or 6.8, g3 = 8 or 10.5, alpha = 5% gives f = 9.591107, p = 0.003248, critical = 3.885294, ssb = 27.897333, ssw = 17.452, dfb = 2, dfw = 12. Source: NIST/SEMATECH e-Handbook of Statistical Methods, §7.4.3.3 The ANOVA table and tests of hypotheses about means (resistor data at three temperatures: SST 27.897, SSE 17.452, df 2 and 12, F = 9.59, p = 0.00325), https://www.itl.nist.gov/div898/handbook/prc/section4/prc433.htm (retrieved 2026-10-02); NIST/SEMATECH e-Handbook of Statistical Methods, §7.4.3.4 One-way ANOVA calculations (SST = Σ Tᵢ² ÷ nᵢ − CM, SSE = SS(Total) − SST, MST = SST ÷ (k − 1), MSE = SSE ÷ (N − k), F = MST ÷ MSE), https://www.itl.nist.gov/div898/handbook/prc/section4/prc434.htm (retrieved 2026-10-02).
2. g1 = 6.9 or 5.4, g2 = 8.3 or 6.8, g3 = 8 or 10.5, alpha = 5% gives f = 9.59, p = 0.00325, critical = 3.89. Source: NIST/SEMATECH e-Handbook of Statistical Methods, §7.4.3.3 The ANOVA table and tests of hypotheses about means (resistor data at three temperatures: SST 27.897, SSE 17.452, df 2 and 12, F = 9.59, p = 0.00325), https://www.itl.nist.gov/div898/handbook/prc/section4/prc433.htm (retrieved 2026-10-02) (rounded to 3 significant digits, so tolerance 2e-3).
3. g1 = 1 or 2, g2 = 4 or 5, alpha = 5% gives f = 13.5, p = 0.021312, ssb = 13.5, ssw = 4, msw = 1, dfb = 1, dfw = 4, means = Group 1: 2; Group 2: 5, grand = 3.5. Source: NIST/SEMATECH e-Handbook of Statistical Methods, §7.4.3.4 One-way ANOVA calculations (SST = Σ Tᵢ² ÷ nᵢ − CM, SSE = SS(Total) − SST, MST = SST ÷ (k − 1), MSE = SSE ÷ (N − k), F = MST ÷ MSE), https://www.itl.nist.gov/div898/handbook/prc/section4/prc434.htm (retrieved 2026-10-02).

## FAQ

### What does a one-way ANOVA test?

Whether the means of two or more groups are all equal. It compares the variation between the group means with the variation within the groups. A large F, and a small p-value, says that at least one mean differs.

### How is the F statistic calculated?

F = MST ÷ MSE. MST is the between-group sum of squares divided by k − 1, and MSE is the within-group sum of squares divided by N − k, for k groups and N values in all.

### How do I read the p-value?

It is the chance of an F at least this large if all the means were equal. When it is below your significance level α (often 5%), reject equal means. For NIST’s resistor data, F = 9.59 and p = 0.00325, so the three temperatures differ.

### What are the degrees of freedom in ANOVA?

Between groups: k − 1. Within groups: N − k. Total: N − 1. With 3 groups of 5 values, that is 2, 12 and 14.

### Can the groups have different sizes?

Yes. Each group mean is weighted by its size in the between-group sum of squares. The test is most robust to unequal variances when the groups are about the same size.

### Does ANOVA tell me which groups differ?

No. A significant F says that not all means are equal. To find which pairs differ, follow up with a multiple-comparison method, such as Tukey’s, or with planned contrasts.

### What are the assumptions of ANOVA?

Independent random samples, each from a normal population, with equal variances. With two groups, the one-way ANOVA F equals the square of the pooled two-sample t statistic.

## Sources

- NIST/SEMATECH e-Handbook of Statistical Methods, §7.4.3.3 The ANOVA table and tests of hypotheses about means (the resistor example: SST = 27.897, SSE = 17.452, df 2 and 12, F = 9.59, F₀.₀₅; ₂, ₁₂ = 3.89, p = 0.00325). https://www.itl.nist.gov/div898/handbook/prc/section4/prc433.htm (retrieved 2026-10-02)
- NIST/SEMATECH e-Handbook of Statistical Methods, §7.4.3.4 One-way ANOVA calculations (CM, SS(Total), SST, SSE, MST, MSE and F). https://www.itl.nist.gov/div898/handbook/prc/section4/prc434.htm (retrieved 2026-10-02)
