Inferential Statistics • Lesson 18
ANOVA Basics
Learn how ANOVA compares the means of three or more groups by separating overall variation into between-group and within-group variation.
What You Will Learn
1. What Is ANOVA?
ANOVA stands for Analysis of Variance.
ANOVA is used to test whether there is evidence that the population means of multiple groups are not all equal.
Group A
₹2,400
Average revenue
Group B
₹2,850
Average revenue
Group C
₹3,100
Average revenue
Instead of performing many separate two-sample tests, ANOVA provides one overall test for whether the group means differ.
2. Why Not Just Run Many t-Tests?
Suppose you have three groups: A, B, and C. You could compare A vs B, A vs C, and B vs C separately.
A vs B
A vs C
B vs C
Running many hypothesis tests can increase the overall chance of a false positive. ANOVA provides a single overall test of the equality of the group means.
3. ANOVA Hypotheses
Null Hypothesis
H₀: μ₁ = μ₂ = μ₃ = ...
All population group means are equal.
Alternative Hypothesis
Hₐ: Not all population means are equal
At least one population mean differs from another.
Important:
A significant ANOVA result tells you that not all means are equal. It does not by itself tell you exactly which groups differ.
4. The Main Idea: Variation
ANOVA compares two sources of variation:
Between-Group Variation
How different are the group means from the overall mean?
Group means far apart
→ More between-group variation
Within-Group Variation
How much do individual observations vary around their own group mean?
Observations spread within groups
→ More within-group variation
Visual Intuition
Imagine three groups of customer spending.
Group A
Group B
Group C
If observations are tightly clustered within each group but the group means are far apart, the between-group variation can be large relative to within-group variation.
5. The F-Statistic
ANOVA uses the F-statistic to compare between-group variation with within-group variation.
F = MSBetween / MSWithin
MS Between
Mean square representing variation between group means.
MS Within
Mean square representing variation within the groups.
Intuition:
A larger F-statistic means between-group variation is large relative to within-group variation.
6. Mean Squares and Degrees of Freedom
| Quantity | Degrees of Freedom | Mean Square |
|---|---|---|
| Between Groups | k − 1 | SSBetween / (k − 1) |
| Within Groups | N − k | SSWithin / (N − k) |
Here k is the number of groups and N is the total number of observations across all groups.
Worked Example: Three Marketing Strategies
A company compares the daily sales generated by three marketing strategies.
Strategy A
20, 22, 21, 23
Strategy B
28, 30, 29, 31
Strategy C
24, 25, 23, 24
Group means:
Strategy A = 21.5
Strategy B = 29.5
Strategy C = 24.0
Overall mean:
25.0
Interpretation of the setup:
The group means are visibly different, while observations within each group are relatively close together. ANOVA formally tests whether this pattern provides enough evidence against the null hypothesis of equal population means.
7. How Do We Make the Decision?
The F-statistic is evaluated using the appropriate F-distribution, degrees of freedom, and significance level.
If p ≤ α
Reject H₀. The data provide sufficient evidence that the group means are not all equal.
If p > α
Fail to reject H₀. The data do not provide sufficient evidence that the population means differ.
8. What If ANOVA Is Significant?
A significant overall ANOVA result tells us that at least one population mean differs, but it does not identify the specific groups responsible for the difference.
Post-hoc comparisons
Researchers can use appropriate post-hoc procedures, such as Tukey's HSD, to investigate which group pairs differ while accounting for multiple comparisons.
9. Important ANOVA Assumptions
Observations are independent according to the study design.
The outcome variable is quantitative.
The outcome is approximately normally distributed within each population group, especially important for smaller samples.
The population variances are reasonably similar for the standard one-way ANOVA procedure.
10. ANOVA vs t-Test
| Feature | t-Test | One-Way ANOVA |
|---|---|---|
| Typical comparison | Two means | Three or more means |
| Main statistic | t | F |
| Overall question | Is the difference between two means supported by evidence? | Are all population means equal? |
When there are exactly two independent groups, a suitable two-sample t-test and one-way ANOVA give equivalent tests of the same mean comparison under corresponding assumptions.
Interactive Practice
Test your understanding of ANOVA.
CHECK YOUR UNDERSTANDING
What is ANOVA primarily used to compare?
CHECK YOUR UNDERSTANDING
What does the F-statistic compare?
CHECK YOUR UNDERSTANDING
What is the usual null hypothesis in one-way ANOVA?
CHECK YOUR UNDERSTANDING
If an ANOVA p-value is 0.02 and α = 0.05, what is the decision?
CHECK YOUR UNDERSTANDING
A significant overall ANOVA result tells us that:
CHECK YOUR UNDERSTANDING
For one-way ANOVA with k groups, what is the between-group degrees of freedom?
Fill in the Blanks
ANOVA stands for Analysis of ______.
The ANOVA test statistic is called the ______ statistic.
Between-group degrees of freedom equal k − ______.
Within-group degrees of freedom equal N − ______.
Data Analytics Challenge
Compare Three Sales Teams
A company wants to determine whether three sales teams have the same average daily sales.
Team A
20, 22, 21, 23
Team B
28, 30, 29, 31
Team C
24, 25, 23, 24
Group means:
Team A = 21.5
Team B = 29.5
Team C = 24.0
Overall mean:
25.0
Number of groups:
k = 3
Total observations:
N = 12
Degrees of freedom:
Between = k − 1 = 3 − 1 = 2
Within = N − k = 12 − 3 = 9
Final Challenge
Customer Spending by Membership Plan
An e-commerce company wants to compare average customer spending across three membership plans.
Basic
₹1,800, ₹2,000, ₹2,200
Standard
₹2,400, ₹2,500, ₹2,600
Premium
₹3,000, ₹3,200, ₹3,100
Your task:
- State H₀ and Hₐ.
- Calculate the three group means.
- Calculate the overall mean.
- Calculate the between-group degrees of freedom.
- Explain what a significant ANOVA result would mean.
Basic mean = ₹2,000
Standard mean = ₹2,500
Premium mean = ₹3,100
Overall mean = ₹2,533.33
H₀: μ₁ = μ₂ = μ₃
Hₐ: Not all population means are equal
Between-group df = 3 − 1 = 2
If the ANOVA result is statistically significant, it would provide evidence that the three population means are not all equal. It would not by itself identify which specific plans differ.
Lesson Summary
✓ ANOVA compares multiple population means.
✓ One-way ANOVA is commonly used for three or more groups.
✓ H₀ states that all population means are equal.
✓ Hₐ states that not all population means are equal.
✓ ANOVA separates between-group and within-group variation.
✓ The F-statistic compares the two sources of variation.
✓ A significant ANOVA result means at least one population mean differs.
✓ Post-hoc tests can identify which groups differ.