🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
Search courses…
💼 Servicesℹ️ About✉️ ContactView Pricing Plansfrom $10

One-Way ANOVA — Comparing Multiple Group Means

Foundations of StatisticsAnalysis of Variance🟢 Free Lesson

Advertisement

One-Way ANOVA

Foundations of Statistics

Comparing Multiple Group Means Simultaneously

One-way ANOVA tests whether three or more group means differ significantly, controlling the family-wise error rate. The F-statistic compares between-group variance to within-group variance, with post-hoc tests identifying which specific groups differ.

  • Pharmaceutical Research — Compare efficacy across multiple drug dosages

  • Agriculture — Test crop yield differences across fertilizer types

  • Education — Evaluate teaching effectiveness across multiple methods

The F-test asks whether any group stands out — post-hoc tests reveal which ones.


Motivation

When comparing kk group means, conducting all pairwise tt-tests inflates the Type I error rate. With k=4k = 4 groups, there are (42)=6\binom{4}{2} = 6 pairwise comparisons. If each is tested at α=0.05\alpha = 0.05, the family-wise error rate can exceed 1(10.05)60.261 - (1-0.05)^6 \approx 0.26 — far above the nominal 5%.

ANOVA (Analysis of Variance) tests all group means simultaneously with a single test, controlling the overall Type I error at α\alpha.


The Statistical Model

DfOne-Way ANOVA Model

Yij=μ+αi+εij,i=1,,k,  j=1,,niY_{ij} = \mu + \alpha_i + \varepsilon_{ij}, \quad i = 1, \ldots, k, \; j = 1, \ldots, n_i

where:

  • μ\mu is the overall (grand) mean

  • αi\alpha_i is the effect of group ii (with wiαi=0\sum w_i \alpha_i = 0 for identifiability)

  • εijN(0,σ2)\varepsilon_{ij} \sim \mathcal{N}(0, \sigma^2) i.i.d. — the within-group errors

  • kk is the number of groups, nin_i is the size of group ii


Hypotheses

ANOVA Hypotheses

H0:μ1=μ2==μkvsH1:at least one μi differsH_0: \mu_1 = \mu_2 = \cdots = \mu_k \quad \text{vs} \quad H_1: \text{at least one } \mu_i \text{ differs}

Here,

  • μi\mu_i=Population mean of group i
  • kk=Number of groups

H0H_0 states that all group means are equal (no treatment effect). H1H_1 is the composite alternative that at least one group mean differs from the others.


The ANOVA Decomposition

ThSum of Squares Decomposition

The total variability in the data decomposes into two components:

SST=SSB+SSW\text{SST} = \text{SSB} + \text{SSW}

where:

SST=i=1kj=1ni(YijYˉ)2(total sum of squares)\text{SST} = \sum_{i=1}^k \sum_{j=1}^{n_i} (Y_{ij} - \bar{Y})^2 \quad \text{(total sum of squares)}
SSB=i=1kni(YˉiYˉ)2(sum of squares between groups)\text{SSB} = \sum_{i=1}^k n_i (\bar{Y}_i - \bar{Y})^2 \quad \text{(sum of squares between groups)}
SSW=i=1kj=1ni(YijYˉi)2(sum of squares within groups)\text{SSW} = \sum_{i=1}^k \sum_{j=1}^{n_i} (Y_{ij} - \bar{Y}_i)^2 \quad \text{(sum of squares within groups)}

Degrees of freedom: dftotal=N1\text{df}_{\text{total}} = N-1, dfbetween=k1\text{df}_{\text{between}} = k-1, dfwithin=Nk\text{df}_{\text{within}} = N-k, where N=niN = \sum n_i.


The F-Statistic

F-Statistic for One-Way ANOVA

F=MSBMSW=SSB/(k1)SSW/(Nk)F = \frac{\text{MSB}}{\text{MSW}} = \frac{\text{SSB}/(k-1)}{\text{SSW}/(N-k)}

Here,

  • MSBMSB=Mean square between = SSB/(k-1)
  • MSWMSW=Mean square within = SSW/(N-k) — estimates s²
  • FF=F-statistic: ratio of between-group to within-group variability

ThDistribution of F Under $H_0$

Under H0H_0 (all means equal) and the normality assumption:

F=MSBMSWFk1,NkF = \frac{\text{MSB}}{\text{MSW}} \sim F_{k-1, \, N-k}

where Fk1,NkF_{k-1, N-k} is the FF-distribution with k1k-1 and NkN-k degrees of freedom.

The intuition: if H0H_0 is true, MSB and MSW both estimate σ2\sigma^2, so F1F \approx 1. If H0H_0 is false, MSB overestimates σ2\sigma^2 (it includes the treatment effect), so FF is large.


Effect Size: Eta-Squared

Eta-Squared

η2=SSBSST=1SSWSST\eta^2 = \frac{\text{SSB}}{\text{SST}} = 1 - \frac{\text{SSW}}{\text{SST}}

Here,

  • η2\eta^2=Proportion of total variance explained by group membership

| η2\eta^2 | Interpretation |

|----------|---------------|

| <0.01< 0.01 | Negligible effect |

| 0.010.060.01 - 0.06 | Small effect |

| 0.060.140.06 - 0.14 | Medium effect |

| >0.14> 0.14 | Large effect |


Assumptions

| Assumption | What It Means | How to Check |

|-----------|---------------|-------------|

| Independence | Observations are independent within and between groups | Study design (randomization) |

| Normality | Within each group, the errors are normally distributed | Shapiro–Wilk test; Q–Q plots |

| Homogeneity of variance | Var(εij)=σ2\text{Var}(\varepsilon_{ij}) = \sigma^2 is constant across groups | Levene's test; Bartlett's test |

Robustness of ANOVA

ANOVA is robust to moderate violations of normality when group sizes are equal (or nearly equal), thanks to the CLT. However, it is sensitive to unequal variances when group sizes are unequal. If Levene's test is significant, use Welch's ANOVA instead.


Post-Hoc Tests

When H0H_0 is rejected, post-hoc tests determine which pairs of groups differ:

| Method | Controls | Best For |

|--------|----------|----------|

| Tukey HSD | Family-wise error rate | All pairwise comparisons |

| Bonferroni | Family-wise error rate | Small number of comparisons |

| Scheffé | Family-wise error rate (conservative) | All possible contrasts |

| Dunnett | Family-wise error rate | Comparisons with a control group |

| Games–Howell | Family-wise error rate | Unequal variances and group sizes |


Key Takeaways

Summary: One-Way ANOVA

  • ANOVA tests all means simultaneously — avoids inflated Type I error of multiple tt-tests

  • F=MSB/MSWF = \text{MSB}/\text{MSW} — large FF means between-group variation exceeds random noise

  • Sum of squares decomposition: SST=SSB+SSW\text{SST} = \text{SSB} + \text{SSW}

  • Assumptions: independence, normality within groups, equal variances

  • Post-hoc tests (Tukey, Bonferroni) identify which specific groups differ

  • η2\eta^2 tells you the proportion of total variance explained by group membership

  • Welch's ANOVA is an alternative when homoscedasticity is violated

Premium Content

One-Way ANOVA — Comparing Multiple Group Means

Unlock this lesson and 900+ advanced tutorials with a Premium plan.

🎯End-to-end Projects
💼Interview Prep
📜Certificates
🤝Community Access

Already a member? Log in

Need Expert Statistics Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement