Two-Way Analysis of Variance (ANOVA)
Course: MPC-006 Statistics in Psychology ยท Block 3 ยท Unit 4
Pages: 96โ112 ยท ๐ Download PDF
Prerequisite: One-Way ANOVA | t-Test for Independent & Correlated Samples
From One Factor to Two: Why We Need Two-Way ANOVAโ
One-way ANOVA answers: "Do groups differ on this outcome variable?" โ but it can only examine one independent variable (IV) at a time. Real-world behaviour is shaped by multiple factors acting simultaneously, and often the combination of factors produces an effect that neither factor alone could predict.
Consider a pharmaceutical company testing a new drug to reduce smoking:
- What is the independent effect of Drug A on smoking?
- What is the independent effect of Drug B on smoking?
- What is the joint (interaction) effect of Drug A ร Drug B together?
No single one-way ANOVA can answer all three questions. We need Two-Way ANOVA โ a technique that simultaneously tests:
- The main effect of Factor A (e.g., Type of Personality)
- The main effect of Factor B (e.g., Level of Anxiety)
- The interaction effect A ร B (the combined influence of both factors)
This is the essence of factorial experimental designs โ studying how variables interact, not just act in isolation.
Two-way (and multi-way) ANOVA grew from Fisher's foundational agricultural research in the 1920s, where he needed to simultaneously test the effect of multiple soil treatments and crop varieties. The extension to psychology was pioneered by researchers at American universities in the 1940sโ50s. Wikipedia: Factorial experiment
The Structure of Two-Way ANOVAโ
Factorial Design Notationโ
Two-way ANOVA uses a factorial design notation: a ร b, where:
- a = number of levels of Factor A
- b = number of levels of Factor B
- Total cells = a ร b
| Design | Factors | Cells | Example |
|---|---|---|---|
| 2 ร 2 | 2 IVs, 2 levels each | 4 | Gender ร Anxiety (each High/Low) |
| 3 ร 2 | IVโ has 3 levels, IVโ has 2 | 6 | SES (High/Average/Low) ร Gender |
| 4 ร 3 | IVโ has 4 levels, IVโ has 3 | 12 | 4 teaching methods ร 3 intelligence levels |
Three Effects Tested Simultaneouslyโ
The Two-Way ANOVA Summary Tableโ
| Source of Variance | df | SS | MSS | F Ratio |
|---|---|---|---|---|
| Among All Groups | (kโ1) | SS_A | โ | โ |
| Between Groups: Factor A | (k_a โ 1) | SS_BFactorA | MSS_A | Fโ = MSS_A / MSS_W |
| Between Groups: Factor B | (k_b โ 1) | SS_BFactorB | MSS_B | Fโ = MSS_B / MSS_W |
| Interaction A ร B | (k_aโ1)(k_bโ1) | SS_AxB | MSS_AxB | Fโ = MSS_AxB / MSS_W |
| Within Groups (Error) | (N โ k) | SS_W | MSS_W | โ |
| Total | N โ 1 | SS_T | โ | โ |
The within-groups (error) variance is the denominator for all three F-ratios โ it represents the variability that cannot be attributed to any experimental factor.
Variance Partitioning in Two-Way ANOVAโ
The total variance is carved into more components than in one-way ANOVA:
Therefore:
This elegant partition means that two-way ANOVA accounts for more sources of variance than one-way ANOVA, leaving a smaller (and more accurate) error term. This increases statistical power โ the ability to detect true effects.
Step-by-Step Computationโ
Notation for a 2 ร 2 Designโ
| Symbol | Meaning |
|---|---|
| Total number of cells/groups | |
| Levels of Factor A | |
| Levels of Factor B | |
| Cases per cell | |
| Total cases = | |
| Cell sums | |
| Correction term |
The Computation Stepsโ
Step 1: Correction Term
Step 2: Total Sum of Squares
Step 3: Sum of Squares Among All Groups (treats all cells as separate groups)
Step 4: SS for Factor A (combine cells that share the same level of A)
Step 5: SS for Factor B (combine cells that share the same level of B)
Step 6: Interaction SS
Step 7: Within-Groups SS (Error)
Step 8: Degrees of Freedom
Step 9: Mean Squares
Step 10: F-Ratios
Worked Example 1: Anxiety ร Personality Type on Academic Achievementโ
Source: PDF p. 99โ102
A researcher studied 20 undergraduates in a 2 ร 2 design (Type of Personality ร Level of Anxiety). Academic achievement scores:
| High Anxiety | Low Anxiety | |
|---|---|---|
| Extroverts | 12, 13, 14, 15, 14 | 14, 14, 13, 15, 15 |
| Introverts | 14, 16, 16, 16, 15 | 11, 10, 12, 12, 16 |
Cell Statistics:
| Cell | ฮฃ | M |
|---|---|---|
| Extroverts ร High Anxiety (Xโ) | 68 | 13.60 |
| Extroverts ร Low Anxiety (Xโ) | 71 | 14.20 |
| Introverts ร High Anxiety (Xโ) | 77 | 15.40 |
| Introverts ร Low Anxiety (Xโ) | 61 | 12.20 |
, ,
Step 1:
Step 2:
Step 3:
Step 4 (Personality Type โ rows):
Extroverts total = 68 + 71 = 139 (n = 10); Introverts total = 77 + 61 = 138 (n = 10)
Step 5 (Anxiety Level โ columns):
High Anxiety total = 68 + 77 = 145 (n = 10); Low Anxiety total = 71 + 61 = 132 (n = 10)
Step 6:
Step 7:
Summary Table:
| Source | df | SS | MSS | F |
|---|---|---|---|---|
| Among Groups | 3 | 26.55 | โ | โ |
| Personality Type (A) | 1 | 0.05 | 0.05 | 0.025 |
| Anxiety Level (B) | 1 | 8.45 | 8.45 | 4.225 |
| A ร B Interaction | 1 | 18.05 | 18.05 | 9.025 |
| Within Groups (Error) | 16 | 32.00 | 2.00 | โ |
| Total | 19 | 58.55 | โ | โ |
Critical F values (dfโ = 1, dfโ = 16): Fโโ = 4.49, Fโโ = 8.53
Decisions:
- Personality Type: F = 0.025 < 4.49 โ Not significant โ personality type alone does not affect academic achievement
- Anxiety Level: F = 4.225 < 4.49 โ Not significant โ anxiety level alone does not affect academic achievement
- Interaction A ร B: F = 9.025 > 8.53 โ Significant at .01 level โ โ the combination of personality type and anxiety level matters!
Interpretation: Although neither personality type nor anxiety individually predicts achievement, their joint effect does. Specifically: Introverts with high anxiety perform best (M = 15.40), while Introverts with low anxiety perform worst (M = 12.20). Extroverts show a more moderate, reversed pattern. This cross-over interaction is the hallmark of a significant A ร B effect.
Worked Example 2: Sex ร Intelligence on Mathematical Creativityโ
Source: PDF p. 103โ106
40 high school students in a 2 ร 2 design: Sex (Boys/Girls) ร Intelligence (High/Low). Dependent variable: mathematical creativity test scores.
Cell Summary:
| Cell | n | ฮฃ | M |
|---|---|---|---|
| Boys ร High Intelligence | 10 | 153 | 15.30 |
| Boys ร Low Intelligence | 10 | 137 | 13.70 |
| Girls ร High Intelligence | 10 | 139 | 13.90 |
| Girls ร Low Intelligence | 10 | 111 | 11.10 |
Key Computations:
Summary Table:
| Source | df | SS | MSS | F |
|---|---|---|---|---|
| Sex (A) | 1 | 40.00 | 40.00 | 19.46 โ |
| Intelligence (B) | 1 | 48.40 | 48.40 | 23.54 โ |
| Sex ร Intelligence (AรB) | 1 | 3.60 | 3.60 | 1.75 โ |
| Within Groups (Error) | 36 | 74.00 | 2.056 | โ |
| Total | 39 | 166.00 | โ | โ |
Critical F (dfโ = 1, dfโ = 36): Fโโ = 4.12, Fโโ = 7.42
Decisions:
- Sex: F = 19.46 > 7.42 โ Significant at .01 โ Boys score higher in mathematical creativity (M = 14.50 vs 12.50)
- Intelligence: F = 23.54 > 7.42 โ Significant at .01 โ High-intelligence students score higher (M = 14.60 vs 12.40)
- Sex ร Intelligence: F = 1.75 < 4.12 โ Not significant โ the advantage of high intelligence is roughly equal for both boys and girls
Understanding Interaction Effectsโ
The interaction effect is the most conceptually rich aspect of two-way ANOVA. It answers: "Does the effect of Factor A depend on the level of Factor B?"
Visualising Interaction: Parallel vs Crossing Linesโ
Rule of thumb for interaction graphs:
- Parallel lines โ No interaction (the effect of A is the same at every level of B)
- Non-parallel / crossing lines โ Possible or significant interaction
Practical Examples of Interactionโ
| Domain | Factor A | Factor B | Possible Interaction |
|---|---|---|---|
| Clinical | Drug dosage | Patient age group | Drug effective for adults but not children |
| Education | Teaching method | Intelligence level | Discussion works for bright students; drilling works for others |
| Organisational | Work schedule | Job type | Flexible hours boosts satisfaction for creative jobs but not routine ones |
| Developmental | Parenting style | Child temperament | Authoritative parenting helps anxious children more than easy-going ones |
The fertiliser analogy from the PDF is instructive: Urea and Phosphate each have independent effects on crop growth, but their combined application in the right ratio produces results neither achieves alone โ the joint effect (interaction) is not predictable from individual effects.
Wikipedia: Interaction (statistics)
Decision Rules for Two-Way ANOVA Resultsโ
Three possible outcomes and what to do:
- All F Non-Significant
- All F Significant
- Partial Significance
All three obtained F values (F_A, F_B, F_AxB) are below the critical value.
Conclusion: Neither variable alone nor in combination has a significant effect on the dependent variable. Retain all null hypotheses. No post-hoc tests needed. Report results and stop.
Example: In Example 2, if the interaction F (1.75) had also been non-significant, you would conclude that neither sex, intelligence, nor their combination affects mathematical creativity.
All three F values exceed the critical value.
Conclusion: Each variable has an independent effect AND they interact. Reject all null hypotheses. If either variable has more than two levels, proceed to post-hoc pairwise t-tests to identify which levels differ. The interaction should be graphed and interpreted โ which combination of levels produces the highest/lowest outcome?
One or two F values are significant; others are not.
Conclusion: Null hypotheses are partially retained. This is the most common outcome in real research. Significant main effects are interpreted directly. A significant interaction is always explored further โ it is typically the most theoretically interesting finding. Non-significant effects are reported as having no detectable influence.
Example: Example 1 showed this pattern: personality and anxiety individually were non-significant, but their combination (A ร B interaction) was highly significant (.01 level).
One-Way vs Two-Way ANOVA: A Comparisonโ
| Feature | One-Way ANOVA | Two-Way ANOVA |
|---|---|---|
| Independent variables | 1 | 2 |
| Effects tested | 1 (main effect) | 3 (2 main + 1 interaction) |
| Design type | Simple random design | Factorial design |
| Interaction analysis | Not possible | Core feature |
| F-ratios computed | 1 | 3 |
| Efficiency | Tests one IV at a time | Tests two IVs simultaneously |
| Statistical power | Lower (error includes B variance) | Higher (partitions more variance) |
| Complexity | Moderate | High |
Key insight: Two-way ANOVA is more efficient than running two separate one-way ANOVAs because: (a) it controls for the second factor when testing the first, and (b) it reveals interaction effects that separate analyses cannot detect.
Assumptions of Two-Way ANOVAโ
Two-way ANOVA inherits all the assumptions of one-way ANOVA:
- Normality: The dependent variable is normally distributed within each cell
- Homogeneity of variance: All cells have equal population variance (Levene's test)
- Independence: Observations are independent within and across cells
- Equal cell sizes (balanced design): Makes computation simpler and the test more robust
Additional consideration for two-way designs: With very small cell sizes (n < 5), the test is especially sensitive to violations. Balanced designs (equal n per cell) are strongly preferred.
Wikipedia: Analysis of variance โ Assumptions
Merits and Limitationsโ
- โ Merits
- โ ๏ธ Limitations
- Tests two main effects and one interaction in a single analysis โ three hypotheses for the price of one
- Reveals interaction effects that would be completely invisible to separate one-way ANOVAs
- Higher statistical power than one-way ANOVA โ partitioning the B variance out of error reduces the error term
- Ideal for factorial designs (2ร2, 3ร2, 4ร3 etc.) which closely mimic real-world multi-causal phenomena
- Produces a richer interpretation: not just "does A matter?" but "does A matter more at some levels of B?"
- Foundation for more complex designs: three-way ANOVA, MANCOVA, mixed-model ANOVA all build on this
- Complexity escalates rapidly: 4 independent variables โ 15 effects to interpret
- F-ratio is omnibus: significant F for a factor with 3+ levels still requires post-hoc tests
- Requires equal (or proportional) cell sizes for clean computation; unequal cells require Type III SS
- Assumption-sensitive: violations of normality and homogeneity of variance can invalidate all three F-ratios
- Interpretation of interaction is difficult and requires graphing, especially when both factors have 3+ levels
- Time-consuming: data organisation, computation, and interpretation all multiply with complexity
Indian Research Contextโ
Two-way ANOVA is the backbone of much factorial research in Indian educational and social psychology:
Educational Psychology: Studies examining the joint effects of gender ร school type (government vs private) on academic performance are ubiquitous in Indian M.Ed. dissertations. Frequently, the interaction reveals that gender gaps are larger in private schools than government ones โ a finding invisible to separate one-way analyses.
Clinical Psychology: Indian clinical researchers have used 2ร2 designs to study how diagnosis ร socioeconomic status jointly affect treatment adherence โ finding significant interactions at NIMHANS, PGI Chandigarh, and affiliated centres.
Developmental Psychology: Research on parenting style ร child birth order as predictors of adolescent self-concept is a recurring theme in Indian family psychology, reflecting the culturally distinct role of joint families and sibling hierarchies in India.
Occupational Psychology: Studies on job sector (public vs private) ร gender as determinants of work-life balance report consistent interaction effects, with gender differentials far more pronounced in the private sector โ a pattern with significant policy implications.
Real-World Applicationsโ
- Pharmacology RCTs: Testing drug efficacy across gender ร dosage cells โ the interaction reveals if a drug works differently for men vs women
- Educational interventions: Instruction method ร learning style combinations to personalise teaching
- Neuropsychology: Memory training ร age group interactions in cognitive rehabilitation
- Consumer psychology: Ad format ร product category interactions in purchase decision research
- Health psychology: Exercise type ร dietary regimen combinations in weight loss interventions
Memory Aidsโ
๐ง The "Main + Interaction" Triangleโ
Two-Way ANOVA
/ \
Main Effect A Main Effect B
\ /
Interaction
(A ร B)
Two-Way ANOVA always gives you THREE effects. Never forget the third โ the interaction.
๐ต Parallel Lines Ruleโ
Parallel lines = No interaction (the gap stays the same)
Crossing lines = Interaction present (the relationship reverses)
"Lines that cross mean factors interact; lines that don't means they act apart."
๐ข df Quick Reference for 2ร2 Designsโ
| Effect | df |
|---|---|
| Factor A (2 levels) | |
| Factor B (2 levels) | |
| A ร B interaction | |
| Within groups (N=20) | |
| Total (N=20) |
โก Interaction vs Main Effect Quick Ruleโ
If main effects are not significant but interaction is significant โ The factors only matter together, not alone (Example 1: Personality ร Anxiety)
If main effects are significant but interaction is not โ The factors work additively, not jointly (Example 2: Sex + Intelligence)
External Resourcesโ
๐ Essential Readingโ
- Wikipedia: Two-way analysis of variance โ comprehensive mathematical treatment
- Wikipedia: Interaction (statistics) โ conceptual and graphical explanation
- Statistics How To: Two-Way ANOVA โ step-by-step worked examples with Excel output
๐ Video Lecturesโ
- Crash Course Statistics #34: Two-Way ANOVA โ accessible conceptual introduction
- StatQuest: Two-Way ANOVA (Josh Starmer) โ visual variance partitioning
- Khan Academy: Interactions in factorial ANOVA โ interactive exercises
๐ Research Papers (2020โ2025)โ
- Lakens, D. (2022). Sample size justification. Collabra: Psychology, 8(1). [doi:10.1525/collabra.33267] โ covers power for factorial designs
- Maxwell, S.E., Delaney, H.D., & Kelley, K. (2018). Designing Experiments and Analyzing Data: A Model Comparison Perspective (3rd ed.). Routledge. โ standard advanced reference for factorial ANOVA
- Shieh, G. (2020). Power analysis for two-way balanced ANOVA. Journal of Statistical Computation and Simulation, 90(7). โ for planning two-way designs
๐ Online Toolsโ
- Social Science Statistics: Two-Way ANOVA Calculator โ free browser-based computation
- Real Statistics: Two-Factor ANOVA in Excel โ detailed Excel tutorials with interpretation
- JASP Software โ free, user-friendly statistics software with beautiful ANOVA output for students
Self-Assessment Questionsโ
๐ข Knowledge (Recall)โ
-
Define two-way ANOVA and explain how it differs from one-way ANOVA. What additional information does it provide?
-
Name the three effects tested in a two-way ANOVA. Define each one clearly.
-
State the formula for the interaction sum of squares () in terms of other SS components. Why is the interaction variance calculated this way?
๐ก Comprehension (Understanding)โ
-
Explain the interaction effect using a concrete example from psychology. What does it mean when two lines on an interaction graph are parallel versus when they cross?
-
In Example 1 (Anxiety ร Personality), the main effects of both factors were non-significant, yet the interaction was highly significant at .01 level. How is this possible? What does this tell us about the relationship between personality type, anxiety, and academic achievement?
-
Compare Example 1 and Example 2 in terms of their interaction findings. In which example do the two factors act additively? In which do they interact? How do the graphs for each differ?
๐ด Application (Problem-Solving)โ
- Solve this problem: A researcher studies the effect of teaching method (Traditional vs Activity-based) and class size (Small: โค20 vs Large: >40) on student satisfaction scores. Data from a 2ร2 design with n = 6 per cell:
| Traditional | Activity-Based | |
|---|---|---|
| Small Class | 14, 13, 15, 12, 14, 13 | 17, 18, 16, 19, 17, 18 |
| Large Class | 10, 11, 9, 12, 10, 10 | 12, 13, 11, 14, 12, 12 |
Apply two-way ANOVA. Calculate , , , , , , and . Complete the summary table and determine significance for each effect.
Summaryโ
| Concept | Key Point |
|---|---|
| Two-way ANOVA | Tests 2 main effects + 1 interaction simultaneously |
| Factorial design | a ร b notation (levels of A ร levels of B) |
| Main effect | Effect of one IV while controlling for the other |
| Interaction effect | Effect of A depends on the level of B (and vice versa) |
| Parallel lines (graph) | No interaction โ effects are additive |
| Crossing lines (graph) | Significant interaction โ effects are multiplicative/conditional |
| All F non-significant | Retain all Hโ; no further testing |
| Some F significant | Partial rejection; post-hoc t-tests for factors with 3+ levels |
| Advantage over 1-way | Detects interaction; higher power; tests two IVs in one analysis |
| Assumption | Normality, homogeneity of variance, independence, balanced cells |
Source PDFs:
- ๐ Block-3/Unit-4.pdf โ Pages 96โ112
- ๐ MPC-006 Statistics in Psychology, IGNOU