One-Way ANOVA: Formula, Examples, and How to Calculate It by Hand

By StatCalc.net Team Reviewed by — Senior Statistician & Editor Last updated 17 min read
One-Way ANOVA - definition, and how to find it by hand with examples

A one-way ANOVA is a statistical test used to determine whether there is a significant difference between the means of three or more independent groups. For example, suppose a university wants to compare mean examination scores among students taught using three different teaching methods. A one-way ANOVA can be used to determine whether the observed differences in the sample means provide sufficient evidence that the population means are not all equal.

But how does a one-way ANOVA work, and how can you calculate it manually?

In this guide, we explain the one-way ANOVA, its hypotheses and formulas, how to calculate it by hand using raw or summary data, and how to interpret the results.

What Is a One-Way ANOVA?

A one-way ANOVA, also known as a one-way analysis of variance, is a statistical test used to determine whether there is a difference in mean between three or more independent groups. It is an extension of the independent-samples t-test, especially when the number of groups is more than two.

A one-way ANOVA is called “one-way” because it examines the effect of one categorical independent variable, also called a factor, on one quantitative dependent variable.

For example, suppose a researcher wants to determine whether students taught using lecture, flipped-classroom, and hybrid teaching methods have different mean examination scores.

In this case:

  • Teaching method is the independent variable or factor.
  • Lecture, flipped classroom, and hybrid are the three levels of the factor.
  • Examination score is the dependent variable.

In this case, a one-way ANOVA would help you test whether the mean examination scores are equal across the three teaching methods.

When Should You Use a One-Way ANOVA?

Use a one-way ANOVA when you want to compare the mean of a quantitative variable across three or more independent groups defined by one categorical variable.

Generally, the following should be true:

  • You have one categorical independent variable.
  • The independent variable has two or more independent groups, although one-way ANOVA is most commonly used with three or more groups.
  • You have one quantitative dependent variable.
  • Each observation belongs to only one group.

For example, suppose a researcher compares average mathematics scores among students attending public, private, and charter schools. School type is one categorical independent variable with three groups, while mathematics score is the quantitative dependent variable. In this case, a one-way ANOVA would be appropriate.

How Does a One-Way ANOVA Work?

Although ANOVA is used to compare means, the test makes the comparison by examining variation in the data.

It divides the total variation into two main components:

  1. Between-group variation, which measures how far the group means are from the overall or grand mean.
  2. Within-group variation, which measures how much individual observations vary around their respective group means.

The F statistic compares these two sources of variation. Therefore, the F-statistic formula for a one-way ANOVA is:

F = MSB / MSW

Where:

  • MSB is the mean square between groups.
  • MSW is the mean square within groups.

If the population means are equal, the between-group and within-group variation should be relatively similar, and F will generally be closer to 1. However, when the differences among the group means are large relative to the variation within the groups, the F statistic becomes larger. A sufficiently large F statistic provides evidence against the null hypothesis.

One-Way ANOVA Hypotheses

A one-way ANOVA tests whether all population means are equal.

The null hypothesis is: H₀: μ₁ = μ₂ = … = μₖ (All population means are equal)

The alternative hypothesis is: H₁: At least one population mean is different.

Where:

  • μ₁, μ₂, …, μₖ are the population means.
  • k is the number of groups.

Notice that the alternative hypothesis does not state that all the means are different. A significant ANOVA only tells us that at least one population mean differs from another.

It does not tell us which specific groups differ. If the ANOVA is statistically significant, an appropriate post hoc test can be used to identify the differences.

Key Formulas for Calculating a One-Way ANOVA by Hand

To calculate a one-way ANOVA by hand, you need to calculate the group means, grand mean, sums of squares, degrees of freedom, mean squares, and finally the F statistic.

The key formulas are summarized below.

1. Group Mean

For each group, calculate the sample mean using:

x̄ⱼ = Σxⱼ / nⱼ

Where:

  • x̄ⱼ is the mean of group j.
  • Σxⱼ is the sum of the observations in group j.
  • nⱼ is the sample size of group j.

2. Grand Mean

The grand mean is the mean of all observations across all groups.

When raw data are available:

x̄.. = Σx / N

Where:

  • Σx is the sum of all observations.
  • N is the total number of observations across all groups.

If you only have the sample size and mean for each group, use the weighted grand mean: x̄.. = Σ(nⱼx̄ⱼ) / N

3. Between-Groups Sum of Squares

The between-groups sum of squares measures variation caused by differences among the group means.

SSB = Σ[nⱼ(x̄ⱼ − x̄..)²]

Where:

  • nⱼ is the sample size of group j.
  • x̄ⱼ is the mean of group j.
  • x̄.. is the grand mean.

The between-groups sum of squares is also called the treatment sum of squares.

4. Within-Groups Sum of Squares

The within-groups sum of squares measures variation among observations within their respective groups.

When raw data are available:

SSW = ΣΣ(xᵢⱼ − x̄ⱼ)²

Where:

  • xᵢⱼ is an individual observation in group j.
  • x̄ⱼ is the mean of group j.

If you only have the sample size and sample standard deviation for each group, calculate the within-groups sum of squares using:

SSW = Σ[(nⱼ − 1)sⱼ²]

Where:

  • nⱼ is the sample size of group j.
  • sⱼ is the sample standard deviation of group j.

The within-groups sum of squares is also called the error sum of squares.

5. Total Sum of Squares

The total sum of squares represents the total variation in the data.

SST = SSB + SSW

6. Degrees of Freedom

For k groups containing a total of N observations, the degrees of freedom formulas for a one-way ANOVA are:

  • df Between = k − 1
  • df Within = N − k
  • df Total = N − 1

You may use the degrees of freedom calculator to quickly compute these values if you already know k and N

7. Mean Squares

The between-groups mean square is: MSB = SSB / df Between or MSB = SSB / (k − 1)

The within-groups mean square is: MSW = SSW / df Within or MSW = SSW / (N − k)

8. F Statistic

This is the test statistic in a one-way ANOVA. The formula is: F = MSB / MSW. The calculated F statistic follows an F distribution with:

  • Numerator degrees of freedom, df₁ = k − 1
  • Denominator degrees of freedom, df₂ = N − k

Once you have F, df₁, and df₂, you can find the p-value or compare the calculated F statistic with the F critical value to make the hypothesis-testing decision.

How to Calculate a One-Way ANOVA by Hand

To perform a one-way ANOVA manually, follow these steps:

  1. State the null and alternative hypotheses.
  2. State the significance level, α.
  3. Calculate the F test statistic. To find the test statistic, follow these sub-steps:
    1. Find the mean of each group and the overall mean
    2. Calculate the Sum of Squares for Treatment, SST
    3. Calculate the Sum of Squares for Error, SSE
    4. Calculate the total sum of squares, SS Total
    5. Finding the degrees of freedom
    6. Calculate the Mean Square for Treatment, MST
    7. Calculate the Mean Square for Error, MSE
    8. Calculate the F statistic
  4. Find the p-value and F critical value.
  5. Decide whether to reject or fail to reject the null hypothesis.
  6. Write the conclusion in the context of the problem.

Example 1: One-Way ANOVA by Hand (Raw Data)

A university researcher wants to compare the effectiveness of three instructional formats. Fifteen first-year students are randomly assigned to a lecture course, a flipped-classroom course, or a hybrid course. At the end of the unit, each student completes the same examination.

The scores are:

LectureFlipped ClassroomHybrid
728077
758276
787979
748178
768380

At the 0.05 significance level, determine whether the mean examination scores differ among the three instructional formats. Assume the conditions for a one-way ANOVA are satisfied.

Solution

Step 1: State the Hypotheses

We are testing whether all three population means are equal. Therefore, the hypotheses are:

  • H₀: μ₁ = μ₂ = μ₃
  • H₁: At least one population mean is different.

Step 2: State the Significance Level

We want to test the hypothesis at the 0.05 significance level. Thus, α = 0.05

Step 3: Calculate the Test Statistic

To calculate the F-statistic for the test, follow these sub-steps:

i) Calculate the Group Means and Overall Mean

By definition, the sample mean formula is: x̄ = Σxi / n

Substituting the values into the formula, we get the mean of each group as follows:

Lecture group mean: x̄1 = (72 + 75 + 78 + 74 + 76) / 5

= 375 / 5

= 75

Flipped-classroom group mean: x̄2 = (80 + 82 + 79 + 81 + 83) / 5

= 405 / 5

= 81

Hybrid group mean: x̄3 = (77 + 76 + 79 + 78 + 80) / 5

= 390 / 5

= 78

The overall (Grand mean) is: x̄.. = (375 + 405 + 390) / 15

= 1170 / 15

= 78

You can also compute the group means quickly using the sample mean calculator or the average calculator.

ii) Calculate the Sum of Squares for Treatment

By definition, the treatment sum of squares formula is: SST = Σ[nⱼ(X̄ⱼ − X̄..)²]

Substituting the values into the formula, we get:

SST = 5(75 − 78)² + 5(81 − 78)² + 5(78 − 78)²

= 45 + 45 + 0

= 90

iii) Calculate the Sum of Squares for Error

By definition, the error sum of squares formula is: SSE = Σ(xij – x̄j)2. This means we need to find the sum of squares after subtracting each group mean from each group observation.

Therefore:

For the lecture group: SSE1 = (72 − 75)² + (75 − 75)² + (78 − 75)² + (74 − 75)² + (76 − 75)²

= 9 + 0 + 9 + 1 + 1

= 20

For the flipped-classroom group: SSE2 = (80 − 81)² + (82 − 81)² + (79 − 81)² + (81 − 81)² + (83 − 81)²

= 1 + 1 + 4 + 0 + 4

= 10

For the hybrid group: SSE3 = (77 − 78)² + (76 − 78)² + (79 − 78)² + (78 − 78)² + (80 − 78)²

= 1 + 4 + 1 + 0 + 4

= 10

Therefore, SSE = SSE1 + SSE2 + SSE3

= 20 + 10 + 10

= 40

iv) Calculate the Total Sum of Squares

By definition, the total sum of squares is: SStotal = SST + SSE

= 90 + 40

= 130

v) Calculate the Mean Squares

By definition, the mean treatment sum of squares formula is: MST = SST / k-1, where k is the number of groups.

Therefore, MST = = 90 / (3-1)

= 45

Also, the mean sum of squares due to error, MSE = SSE/N-k, where N is the total number of observations across groups and k is the number of groups.

Therefore, MSE = 40 / (15-3)

= 40/12

= 3.3333

Note. The k-1 and N-k are the numerator degrees of freedom (df1) and denominator degrees of freedom (df2), respectively.

vi) Calculate the F Statistic

By definition, the F statistic formula for a one-way ANOVA is: F = MST / MSE

= 45 / 3.3333

= 13.5

Step 4: Find the P-Value and Critical Value

We can quickly find the p-value for the test using the p-value calculator. Just follow these steps:

  1. Click p-value from F statistic
  2. Enter F = 13.5, df₁ = 2, and df₂ = 12
  3. Click Calculate

The calculator will instantly return the p-value as: p-value = 0.000849

Also, we can find the critical value either by looking up F0.05, 2, 12 from the F table or using the F critical value calculator for instant results. Using the F critical value calculator, just enter α = 0.05, df1 = 2, df2 = 12, and click calculate. The calculator will instantly return the F-critical value as: F critical = 3.8853

Using the values from step 3 (ii-vi) and Step 4, we can complete the ANOVA table as follows:

SourceSSdfMSFpF Critical
Treatment9024513.50.0008493.8853
Error40123.3333———
Total13014————

Step 5: Make the Decision

  • P-value approach: Since the p-value (0.000849) is less than the significance level (α = 0.05), we reject the null hypothesis (H₀).
  • Critical value approach: Since the test statistic (F = 13.5) is greater than the F critical value (3.8853), we reject the null hypothesis (H₀).

Both approaches give the same decision.

Step 6: Write the Conclusion

At the 0.05 significance level, there is sufficient evidence to conclude that at least one mean examination score differs among the three instructional formats.

Tip. Since the one-way ANOVA table result is statistically significant, the researcher should conduct a post hoc analysis to determine which instructional formats differ.

You can verify the results using the one-way ANOVA Calculator.

Calculating a One-Way ANOVA From Summary Statistics

You do not always need the original observations to perform a one-way ANOVA. If you know the following information for every group, it is possible to perform a one-way ANOVA:

  • Sample size, n
  • Sample mean, x̄
  • Sample standard deviation, s

The main difference is how we calculate the grand mean and within-groups sum of squares. In this case, the weighted grand mean formula is: x̄.. = Σ(nⱼx̄ⱼ) / N, and the within-groups sum of squares is: SSW = Σ[(nⱼ − 1)sⱼ²]

Example 3: One-Way ANOVA by Hand (Summary Data)

A healthcare administration researcher compares patient waiting times under three scheduling systems. The researcher has access only to the sample size, mean waiting time, and sample standard deviation for each system.

Scheduling SystemSample SizeMean Waiting TimeSample SD
System A1214.22.4
System B1011.82.1
System C149.92.6

At the 0.05 significance level, test whether the population mean waiting times differ among the three scheduling systems. Assume the one-way ANOVA conditions are satisfied.

Solution

Given the summary statistic data, we can perform the one-way ANOVA as follows:

Step 1: State the Hypotheses

We want to test the hypotheses:

  • H₀: There is no significant difference in mean waiting times (μ₁ = μ₂ = μ₃)
  • H₁: At least one population mean waiting time is different.

Step 2: State the Significance Level

We want to test the hypothesis at the 0.05 significance level. Therefore, α = 0.05

Step 3: Calculate the Test Statistic

i) Calculate the Overall Mean

Because summary data were provided, the group means do not need to be calculated from raw observations.

The total sample size is: N = 12 + 10 + 14

= 36

We can also compute the grand mean using the formula: X̄.. = Σ(nⱼX̄ⱼ) / N

Substituting the values into the formula gives:

X̄.. = [12(14.2) + 10(11.8) + 14(9.9)] / 36

= (170.4 + 118 + 138.6) / 36

= 427 / 36

X̄.. = 11.8611

You can also use the weighted mean calculator for instant results.

ii) Calculate the Sum of Squares for Treatment

By definition, the sum of squares due to treatment formula is: SST = Σ[nⱼ(X̄ⱼ − X̄..)²]

Substituting the values, we get:

SST = 12(14.2 − 11.8611)² + 10(11.8 − 11.8611)² + 14(9.9 − 11.8611)²

= 65.6448 + 0.0373 + 53.8434

= 119.5256

iii) Calculate the Sum of Squares for Error

Because only summary statistics are available, we use the following simplified formula to get the sum of squares due to error.

SSE = Σ[(nⱼ − 1)sⱼ²]

Substituting the values, we get:

SSE = (12 − 1)(2.4)² + (10 − 1)(2.1)² + (14 − 1)(2.6)²

= 11(5.76) + 9(4.41) + 13(6.76)

= 63.36 + 39.69 + 87.88

Thus, SSE = 190.93

iv) Calculate the Total Sum of Squares

By definition, SStotal = SST + SSE

= 119.5256 + 190.93

= 310.4556

v) Calculate the Mean Squares

From the summary statistics data, we can calculate the numerator and denominator degrees of freedom as follows:

  • df₁ = k − 1 = 3 − 1 = 2
  • df₂ = N − k = 36 − 3 = 33

By definition, Mean sum of squares due to treatment, MST = SST / df₁

= 119.5256 / 2

= 59.7628

Also, mean sum of squares due to error, MSE = SSE / df₂

= 190.93 / 33

= 5.7858

vi) Calculate the F Statistic

By definition, the test statistic is F = MST / MSE

= 59.7628 / 5.7858

= 10.3293

Step 4: Find the P-Value and Critical Value

Using the p-value from the F calculator and entering F = 10.3293, df₁ = 2, and df₂ = 33, the p-value for the test is: p-value = 0.000328

Additionally, using the F critical value calculator and entering α = 0.05, df₁ = 2, and df₂ = 33, the critical value for the test is 3.2849

Now, using the values from steps 3 (ii-vi) and 4, we can complete the ANOVA table as follows:

SourceSSdfMSFpF Critical
Treatment119.5256259.762810.32930.0003283.2849
Error190.93335.7858———
Total310.455635————

Step 5: Make the Decision

  • P-value approach: Since the p-value (0.000328) is less than the significance level (0.05), we reject the null hypothesis (H₀).
  • Critical value approach: Since the test statistic (F = 10.3293) is greater than the critical value (3.2849), we reject the null hypothesis (H₀).

Step 6: Write the Conclusion

At the 0.05 significance level, there is sufficient evidence to conclude that at least one population mean waiting time differs among the three scheduling systems. A post hoc comparison is needed to identify which scheduling systems have different mean waiting times.

How to Interpret a One-Way ANOVA

The main purpose of the ANOVA is to decide whether the observed differences among the sample means provide sufficient evidence that the population means are not all equal.

There are two common ways to make this decision.

Using the P-Value

Compare the p-value with the significance level, α. If the p-value is less than or equal to the significance level (p ≤ α), we reject the null hypothesis, H₀. However, if the p-value is greater than the significance level (p > α), we fail to reject H₀.

For example, if p = 0.018 and α = 0.05, we would reject the reject H₀ because the p-value (0.018) is less than the 0.05 significance level and conclude that at least one population mean differs.

Tip. If you have the F-statistic, numerator degrees of freedom (df1), and denominator degrees of freedom (df2), you can quickly find the p-value using the p-value from the F calculator or the general p-value calculator.

Using the F Critical Value

You can also compare the calculated F statistic with the critical value from the F distribution. In this case, we make decisions as follows:

  • Reject the null hypothesis, H₀, if the computed F-statistic is greater than the F critical value.
  • Otherwise, we fail to reject the null hypothesis, H₀.

Because the ANOVA F test is right-tailed, sufficiently large positive F values provide evidence against the null hypothesis.

Can a Confidence Interval Be Used to Make the Overall ANOVA Decision?

Unlike tests of a single mean or difference between two means, the omnibus one-way ANOVA does not have one confidence interval that can be compared with a single null value to make the overall decision.

For the overall ANOVA, use the F statistic and p-value or the F critical value.

Confidence intervals become useful after the ANOVA when comparing specific group means. For example, a post hoc confidence interval for a pairwise mean difference that does not include 0 indicates a statistically significant difference between those two groups.

What Does a Significant One-Way ANOVA Mean?

If the one-way ANOVA is statistically significant, reject the null hypothesis that all population means are equal.

However, this only tells us that at least one mean differs.

Suppose an ANOVA compares Groups A, B, and C and produces p < 0.05. From the ANOVA alone, we do not know whether:

  • A differs from B,
  • A differs from C,
  • B differs from C,
  • or several of these differences are statistically significant.

This is why a significant ANOVA is usually followed by a post hoc test.

Tukey HSD is commonly used when you want to compare all pairs of group means and the equal-variance assumption is reasonable.

If the group variances are unequal, particularly when the group sample sizes also differ, Welch’s ANOVA may be more appropriate for the overall test, and Games-Howell can be used for pairwise comparisons.

Why Use ANOVA Instead of Several Independent T-Tests?

You could theoretically compare three groups by conducting separate t-tests for:

  • Group A vs Group B
  • Group A vs Group C
  • Group B vs Group C

However, performing multiple hypothesis tests increases the probability of making at least one Type I error.

A one-way ANOVA first tests all group means simultaneously using a single overall hypothesis test. If the ANOVA is statistically significant, post hoc procedures can then be used to determine which specific group means differ while controlling for multiple comparisons.

One-Way ANOVA Assumptions

Before performing a one-way ANOVA, the following conditions should be considered.

1. Independent Observations

Each observation should be independent of the other observations. For example, the same participant should not appear in more than one independent group. If the same participants are measured repeatedly under different conditions, an ordinary one-way ANOVA is not appropriate. Instead, you should use a repeated-measures ANOVA.

2. Approximate Normality

The dependent variable should be approximately normally distributed within each population group. In practice, this assumption is often assessed by examining the distribution of the observations or model residuals, especially when the sample sizes are small.

Strong outliers can also have a substantial effect on the means and ANOVA results and should be investigated.

3. Homogeneity of Variances

The population variances should be reasonably similar across the groups. This is known as the homogeneity of variance assumption. To test this assumption, we use Levene’s test of equality of variances.

When the variances are clearly unequal, especially when the group sample sizes also differ, Welch’s ANOVA may be preferred to the standard one-way ANOVA.

How to Report a One-Way ANOVA

When reporting a one-way ANOVA, include the F statistic, numerator and denominator degrees of freedom, and p-value.

The general format is: F(df₁, df₂) = F statistic, p = p-value

From Example 1, we could report: F(2, 12) = 13.50, p < .001

A suitable interpretation would be:

A one-way ANOVA showed a statistically significant difference in mean examination scores among the three instructional formats, F(2, 12) = 13.50, p < .001.

Because the overall ANOVA is statistically significant, the next step would be to report the results of the selected post hoc test to identify which teaching methods differ.

You may also report an effect size, such as eta squared, when required.

For a one-way ANOVA: The effect size is eta-squared, η² = SSB / SST. For instance, from Example 1, eta-squared, η² = 90 / 130

= 0.6923

Therefore, approximately 69.23% of the observed variation in examination scores in this sample is associated with differences among the instructional-format groups.

Frequently Asked Questions

What is a one-way ANOVA?

A one-way ANOVA is a hypothesis test used to determine whether the population means of three or more independent groups are equal. It examines one categorical factor and one quantitative dependent variable.

What does “one-way” mean in one-way ANOVA?

“One-way” means that the analysis contains one categorical independent variable or factor. The factor can have several levels or groups.

What is the formula for a one-way ANOVA?

The final one-way ANOVA test statistic is: F = MSB / MSW, where MSB is the mean square between groups and MSW is the mean square within groups. These quantities are obtained from the between-groups and within-groups sums of squares and their respective degrees of freedom.

What happens when a one-way ANOVA is significant?

When p < α, reject the null hypothesis and conclude that the population means are not all equal. The ANOVA does not identify which means differ. As such, you should perform an appropriate post hoc test to determine which groups are statistically different.

Can one-way ANOVA compare two groups?

Mathematically, a one-way ANOVA can compare two independent groups. However, an independent-samples t-test is normally easier to interpret when only two groups are involved. For the standard equal-variance case, the two tests lead to the same significance decision.

What should I use if the group variances are unequal?

When the homogeneity of variance assumption is substantially violated, particularly when the sample sizes are also unequal, Welch’s ANOVA is commonly used instead of the standard one-way ANOVA.

Editorial Review

This guide was prepared by the StatCalc.net Team and reviewed by , Senior Statistician & Editor.

Statistical explanations, formulas, examples, and terminology are reviewed for accuracy, clarity, and consistency.

Cite

Choose APA, MLA, Chicago, or Harvard. Citations credit StatCalc.net as the corporate author.

StatCalc.net. (2026, October 19). One-Way ANOVA: Formula, Examples, and How to Calculate It by Hand. Retrieved October 19, 2026, from https://statcalc.net/one-way-anova/