Atlas
statminds
GLM (Factorial Design Model)The underlying model family class (e.g. GLM, linear model, categorical matrix, log-linear).Parametric ReferenceStatistical methods that assume a specific probability distribution family (typically normal).12-stage workflow

Two-Way ANOVA

The blueprint for Factorial Discovery. Two-Way ANOVA analyzes the synergistic interaction between two independent categorical factors on a single continuous outcome.

Model familyGLM (Factorial Design Model)
Hypothesisomnibus
AliasesFactorial ANOVA · Two-Factor Omnibus Test · Multi-Predictor ANOVA
G1
Interaction Detection
Identify if the effect of one factor DEPENDS on the level of another.
G2
Multi-Factor Synergy
Map the cumulative impact of treatment variables across demographic strata.
G3
Marginal Efficiency
Isolate independent 'Main Effects' while controlling for secondary factors.
Visual Overview Dashboard
1

What is it?

Two-Way ANOVA examines how two independent categorical factors interactively and independently affect a single continuous dependent variable.

2

When to use it

  • 2 Factors: Categorical independent variables (e.g. Treatment and Age).
  • 1 Outcome: Continuous scale variable.
  • Factorial Cells: Data collected for every combination of factors.
3

Core Idea

It isolates three effects: Main Effect of A, Main Effect of B, and the Interaction A×B (which shows if the effect of A depends on B):

Factor A1Factor A2Parallel Slopes = No Interaction

If the lines are parallel, the effect of Factor A is identical across levels of Factor B. If lines cross or converge, a significant interaction is present.

4

Hypotheses

H₀(A): μ_A1 = μ_A2 (No Main Effect A)
H₀(B): μ_B1 = μ_B2 (No Main Effect B)
H₀(AxB): No Interaction (Effects are additive)
5

How it works

  1. Partition SS_Total into SS_A, SS_B, SS_AB, and SS_Error.
  2. Compute mean squares by dividing each by its df.
  3. Test three F-statistics against MS_Error.
6

Assumptions

👤 Cell Independence: Each subject is in exactly one combination.
📊 Cell Normality: Residuals within cells are normal.
⚖️ Homoscedasticity: Variances are equal across all 4 cells.
7

Important Note

⚠️ Interaction Rule: If the Interaction (AxB) is significant, you cannot interpret the Main Effects at face value! You must perform a Simple Main Effects follow-up analysis instead.
8

Quick Example

Age / drugActivePlacebo
Young82.354.1
Old61.052.8
Interactive Sandbox

Two-Way ANOVA Live Laboratory

Manipulate main effects and interaction synergism to audit how variance divides into F-statistics.

Presets
Factor A Main Effect0
Factor B Main Effect0
Synergy (Interaction AB)0
Noise Standard Dev (σ)8
Sample Size per Cell (N)10
Interaction Profile Plot (Non-parallel = Interaction)Y-Axis: Outcome Score
20406080Factor B1 (Young)Factor B2 (Old)Factor A1 (Active)Factor A2 (Control)
Two-Way ANOVA Calculations Table
SourceSSdfMSFp-value
Factor A0.010.00.001.0000
Factor B0.010.00.001.0000
Interaction (AB)0.010.00.001.0000
Error (Within)2304.03664.0--
Three-Part Verdict Card
Factor A (Treatment): ❌ Not Sig.
Factor B (Age Group): ❌ Not Sig.
Synergy (AxB Interaction): ❌ NO Interaction
Effects are independent. Treatment has a consistent effect across both age groups.
The 12-Stage Precision Workflow
01Interaction Logic
Hypotheses
We test three distinct mandates: the two Main Effects and the critical Synergy (Interaction) that defines modern multivariable research.
02Cell-Level Normality
Assumptions
Ensuring that every cell in the factorial grid (e.g., Male-FlowMotion) meets the criteria for parametric aggregation.
03Grid Symmetry
Diagnostics
Using visualization to check if the response patterns are parallel or converging before executing the final F-test.
04Factorial Scenarios
Examples
Analyzing FlowMotion efficacy across different Age Groups, hunting for the specific demographic where the intervention peaks.
05Moderated Pivots
Alternatives
Switching to Moderated Regression if one of the factors is actually continuous, preserving the richness of the original data.
06Simple Effects
Post-hoc
Executing a 'Simple Main Effects' strike to explain EXACTLY why an interaction occurred at a specific group level.
07Partial η²
Effect Size
Isolating the unique variance footprint of each factor after neutralizing the noise of the other.
08Power Allocation
Sample Size
Ensuring the cell sizes are robust enough to detect the interaction, which typically requires 4x more power than simple main effects.
09The Synergy Story
Reporting
Reporting the interaction first—if it's significant, it overrides the main effects and becomes the primary narrative of your discovery.
10Factorial Syntax
Software
Configuring the group factors to handle 'Unbalanced Designs' using Type III Sum of Squares, essential for real-world clinical data.
11Interaction Neglect
Common Mistakes
The fatal error of reporting main effects when a significant interaction exists, which dangerously oversimplifies complex reality.
12Design Lineage
References
Grounding the analysis in the Factorial Experiment traditions established by Yates and Cochran.
01Hypothesis test logic

Hypotheses

Pragmatic null and alternative hypotheses defined in mathematical notation.

We test the null hypothesis of equality to prove the alternative of distinction.
Logic Core
Null · H₀

H₀ (Main effect A): All means across levels of Factor A are equal, averaging over Factor B. H₀ (Main effect B): All means across levels of Factor B are equal, averaging over Factor A. H₀ (Interaction): No interaction between Factor A and Factor B (effects of A are constant across levels of B, and vice versa).

Alternative · Hₐ

Hₐ: At least one mean differs for Factor A OR Factor B, OR there is an A×B interaction (the effect of one factor depends on the level of the other factor).

Why it matters omnibus

Two-way ANOVA simultaneously tests THREE null hypotheses: main effect A, main effect B, and A×B interaction. CRITICAL: If interaction is significant, interpret main effects cautiously—they may be misleading. Instead, conduct simple effects analysis (effect of A at each level of B, or vice versa). With unbalanced designs, use Type III SS to properly partition variance.

02Model diagnostics

Assumptions

The core mathematical criteria needed to ensure that statistical testing remains unbiased and valid.

Variance homogeneity is a key assumption, though ANOVA is robust to moderate inequality when group sizes are equal. Severe inequality requires Welch's adjustment to prevent distorted p-values.
Integrity Shield
7
Assumptions
4
Critical / High Severity
How to check
Quick
Inspect variable type; create histograms to verify scale is not discrete/categorical. DV should be measured continuously (e.g., anxiety score, reaction time, blood pressure), not ordinal categories.
Rigorous
Formal measurement scale validation; verify measurement units are truly interval/ratio with equal distances between values. Check that measurement resolution is sufficient (not just 3-5 ordered categories).
If violated
If ordinal with limited categories (e.g., Likert 1-5) → use ordinal regression or aligned rank transform (ART) for nonparametric factorial ANOVA. If many ordinal levels (7+) → may proceed cautiously. If truly categorical → use log-linear models or chi-square test of independence.
How to check
Quick
Confirm study design: each subject belongs to exactly ONE combination of Factor A × Factor B (e.g., if A = Gender [Male, Female] and B = Treatment [Drug, Placebo], each subject is in one of 4 cells: Male-Drug, Male-Placebo, Female-Drug, Female-Placebo). No subject appears in multiple cells.
Rigorous
Cross-tabulate Factor A by Factor B; verify all cells have independent subjects with no overlap. Check randomization if experimental. Ensure factors are discrete categories, not continuous variables artificially binned.
If violated
If one or both factors are within-subjects (repeated measures) → use two-way repeated measures ANOVA or mixed ANOVA. If factors are continuous (not categorical) → use multiple regression with interaction term (tests slopes, not mean differences). If groups are nested → use nested ANOVA or mixed model with random effects. If only one IV → use one-way ANOVA.
mixed anova
How to check
Quick
Design review: check if any subject IDs appear multiple times; look for clustering indicators (school, site, family IDs, therapist, time). Verify no repeated measures or correlated observations.
Rigorous
Check intraclass correlation (ICC) to detect clustering; Durbin-Watson test if sequential data. Verify sampling design ensures independence within and across cells.
If violated
If repeated measures (same subjects measured multiple times) → use two-way RM-ANOVA or mixed ANOVA. If clustered/nested data (e.g., students within schools, observations within subjects) → use linear mixed model (LMM) with random effects for clusters. If time series/autocorrelation → use GLS with AR(1) structure. Independence violation severely inflates Type I error.
mixed anovalinear mixed modelgee
How to check
Quick
Boxplots by each cell (Factor A × Factor B combination); identify values >1.5 IQR beyond quartiles. Check for extreme z-scores (|z| > 3) within each cell.
Rigorous
Standardized/studentized residuals (|r| > 3 suspect); Cook's distance (D > 1 or D > 4/n); leverage values (hat > 2p/n); influence plots. Outliers can distort interaction tests especially.
If violated
First: verify data entry errors and correct if found. If legitimate outliers: (1) Report results with and without outliers (sensitivity analysis); (2) Use robust ANOVA with trimmed means or M-estimators; (3) Winsorize extreme values to 5th/95th percentiles (pre-specify); (4) Transform DV (log, sqrt, inverse) if outliers due to skewness; (5) Use nonparametric alternatives (aligned rank transform). Never remove outliers without justification.
How to check
Quick
Q-Q plots of residuals for the overall model; histograms of residuals. Check residuals within each cell if sample size permits. Visual inspection for severe skewness or heavy tails.
Rigorous
Shapiro-Wilk test on residuals (p > .05 indicates normality); Anderson-Darling test. Check skewness (<|2|) and kurtosis (<|7|) of residuals. If cell sizes ≥15-20, can assess normality per cell.
If violated
If mild violation with balanced design and n ≥ 30 per cell: ANOVA is robust via CLT, proceed. If notable violation: (1) Transform DV (log for right-skew, sqrt for count-like, inverse for severe right-skew, Box-Cox); (2) Use aligned rank transform (ART) for nonparametric factorial ANOVA; (3) Permutation ANOVA; (4) Generalized linear model (GLM) with appropriate family (e.g., gamma for skewed positive data).
How to check
Quick
Levene's test (tests equal variances across all cells; p > .05 indicates homogeneity). Visual: boxplots for each cell should show similar IQR; residual vs fitted plot should show even spread.
Rigorous
Bartlett's test (sensitive to normality); Brown-Forsythe test (median-based, more robust); plot residuals vs fitted values and check for fanning patterns. Variance ratio: largest/smallest cell variance should be < 3.
If violated
If Levene's p < .05 (heteroscedasticity): (1) Transform DV (log if variance increases with mean; sqrt for count data); (2) Use Welch's ANOVA for unequal variances (available for one-way, limited for two-way); (3) Use heteroscedasticity-robust standard errors (HC3) in linear model framework; (4) Use generalized linear model (GLM) that explicitly models variance structure; (5) Use aligned rank transform (nonparametric). CRITICAL: Unequal variances particularly problematic with unbalanced designs—can inflate Type I error for interaction.
How to check
Quick
Cross-tabulate Factor A by Factor B and count n per cell. Calculate ratio of largest to smallest cell n. Balanced if all cells equal; moderately unbalanced if ratio < 2; severely unbalanced if ratio ≥ 2.
Rigorous
Formal balance test: check if cell sizes are proportional. Examine whether unbalance is by design or due to attrition/missing data. Assess potential impact on power and Type I error.
If violated
Unbalanced designs are common but complicate interpretation. (1) Use Type III sum of squares (default in most software) to properly test main effects and interaction with unequal n. Type II SS can be used if no interaction expected. (2) Ensure smallest cell has adequate sample size (n ≥ 15-20). (3) Check homogeneity of variance carefully—heteroscedasticity + imbalance = major problem. (4) Use weighted least squares if variances differ systematically. (5) Consider whether imbalance is informative (e.g., differential dropout suggests bias).
03Residual Forensics

Diagnostics

Checking residual plots and indices to examine model deviations and ensure standard error integrity.

Trust, but verify. Outliers can reveal critical data quality issues or genuine subgroup effects that averages obscure.
System Health
Essential checks
  1. Levene's test for homogeneity of variance across all cells
  2. Q-Q plot of residuals to assess normality
  3. Boxplots by each cell to identify outliers
  4. Cell sample sizes (n per Factor A × Factor B combination)
  5. Interaction plot (lines for Factor A across Factor B, or vice versa) to visualize interaction
Recommended checks
  1. Residual vs fitted values plot to check homoscedasticity and linearity
  2. Descriptive statistics (M, SD, n) per cell
  3. Variance comparison across cells (ratio of largest to smallest)
  4. Shapiro-Wilk test on residuals (if total n < 50)
  5. Cook's distance to identify influential cases
  6. Power analysis to check adequate power for detecting interaction
  7. Simple effects analysis if interaction is significant
  8. Profile plots showing means for each cell with error bars
04Live Instances

Applied Minds

Review concrete study examples, data layout guidelines, and copy executable syntax scripts.

Theory is the map. Practice is the terrain. Simulation bridges the gap.
Applied Wisdom
Example 01

Gender × Treatment on Anxiety (2×2 Factorial Design)

Research question: Does the effectiveness of CBT for social anxiety differ by gender? Design: 2×2 factorial RCT with Gender (Male, Female) × Treatment (CBT, Waitlist Control), n=30 per cell (total N=120). Outcome: Social Phobia Inventory (SPIN) reduction score from baseline to 12 weeks (continuous, 0-68, higher = more reduction). Hypothesis: Interaction effect—CBT may be more effective for females than males.

Design2×2 between-subjects factorial
Total n120
Outcome ScaleSPIN anxiety reduction score (continuous, 0-68)
# Two-way ANOVA: Gender × Treatment on Anxiety Reduction
# 2×2 factorial design with interaction

library(tidyverse)
library(car)          # For Levene's test, Anova (Type III SS)
library(effectsize)   # For effect sizes
library(emmeans)      # For estimated marginal means and simple effects
library(ggpubr)       # For publication-ready plots

set.seed(2025)

# Simulate realistic data with interaction
# CBT more effective for females than males
data <- data.frame(
  gender = rep(c("Male", "Female"), each=60),
  treatment = rep(rep(c("CBT", "Control"), each=30), 2),
  spin_reduction = c(
    # Male-CBT: moderate effect
    rnorm(30, mean=18.5, sd=8.2),
    # Male-Control: minimal change
    rnorm(30, mean=3.8, sd=7.1),
    # Female-CBT: large effect (INTERACTION)
    rnorm(30, mean=26.3, sd=9.1),
    # Female-Control: minimal change
    rnorm(30, mean=4.2, sd=7.5)
  )
) %>%
  mutate(
    gender = factor(gender, levels=c("Male", "Female")),
    treatment = factor(treatment, levels=c("Control", "CBT"))
  )

# === STEP 1: Descriptive Statistics by Cell ===
cat("=== Cell Descriptives(Mean ± SD) ===\n")
data %>%
  group_by(gender, treatment) %>%
  summarise(
    n = n(),
    M = mean(spin_reduction),
    SD = sd(spin_reduction),
    SE = SD/sqrt(n),
    .groups = 'drop'
  ) %>%
  print()

# === STEP 2: Check Assumptions ===

# 1. Check cell sizes (balance)
cat("\n=== Cell Sizes ===\n")
table(data$gender, data$treatment)

# 2. Levene's test (homogeneity across all 4 cells)
levene_result <- leveneTest(spin_reduction ~ gender * treatment, data=data)
cat("\n=== Levene's Test ===")
print(levene_result)
if (levene_result$`Pr(>F)`[1] > 0.05) {
  cat("✓ Homogeneity of variance assumption met(p > .05)\n")
} else {
  cat("⚠ Heteroscedasticity detected(p < .05). Consider transformation or robust methods.\n")
}

# 3. Normality of residuals
model_for_residuals <- lm(spin_reduction ~ gender * treatment, data=data)
par(mfrow=c(1,2))
plot(model_for_residuals, which=2, main="Q-Q Plot of Residuals")  # Q-Q plot
hist(residuals(model_for_residuals), breaks=20, main="Histogram of Residuals",
     xlab="Residuals", col="lightblue")

shapiro.test(residuals(model_for_residuals))

# 4. Outliers (boxplot by cell)
ggboxplot(data, x="treatment", y="spin_reduction", color="gender",
          palette="jco", add="jitter",
          title="SPIN Reduction by Gender and Treatment",
          xlab="Treatment", ylab="SPIN Reduction Score")

# === STEP 3: Run Two-way ANOVA ===

# Fit model
anova_model <- lm(spin_reduction ~ gender * treatment, data=data)

# Type III SS (recommended for unbalanced designs; handles main effects with interaction)
anova_results <- Anova(anova_model, type=3)
cat("\n=== Two-way ANOVA Results(Type III SS) ===\n")
print(anova_results)

# Alternative: Type II SS (if no interaction expected)
# anova(anova_model)  # Base R gives Type I SS (sequential, order-dependent - NOT recommended)

# === STEP 4: Effect Sizes ===
cat("\n=== Effect Sizes(Partial η²) ===\n")
eta_sq <- eta_squared(anova_results, partial=TRUE)
print(eta_sq)

# Omega squared (less biased)
omega_sq <- omega_squared(anova_results)
cat("\n=== Omega Squared(ω²) ===\n")
print(omega_sq)

# === STEP 5: Interaction Plot ===
interaction_data <- data %>%
  group_by(gender, treatment) %>%
  summarise(M = mean(spin_reduction),
            SE = sd(spin_reduction)/sqrt(n()),
            .groups='drop')

ggplot(interaction_data, aes(x=treatment, y=M, color=gender, group=gender)) +
  geom_line(size=1.2) +
  geom_point(size=4) +
  geom_errorbar(aes(ymin=M-1.96*SE, ymax=M+1.96*SE), width=0.1) +
  labs(title="Interaction: Gender × Treatment on Anxiety Reduction",
       subtitle="Non-parallel lines indicate interaction",
       x="Treatment Condition", y="Mean SPIN Reduction ± 95% CI",
       color="Gender") +
  scale_color_manual(values=c("Male"="#00BFC4", "Female"="#F8766D")) +
  theme_classic(base_size=14) +
  theme(legend.position="right")

# === STEP 6: Post-hoc Analysis ===

# If interaction is significant, conduct simple effects analysis
if (anova_results$`Pr(>F)`[4] < 0.05) {
  cat("\n⚠ Interaction is SIGNIFICANT. Main effects may be misleading.\n")
  cat("Conducting SIMPLE EFFECTS analysis...\n\n")
  
  # Simple effects: Effect of Treatment at each level of Gender
  emm <- emmeans(anova_model, ~ treatment | gender)
  cat("=== Simple Effects: Treatment within each Gender ===\n")
  pairs_simple <- pairs(emm, adjust="bonferroni")
  print(pairs_simple)
  
  # Effect sizes for simple effects
  cat("\n=== Effect Sizes for Simple Effects(Cohen's d) ===\n")
  # Male: CBT vs Control
  male_cbt <- data %>% filter(gender=="Male", treatment=="CBT") %>% pull(spin_reduction)
  male_ctrl <- data %>% filter(gender=="Male", treatment=="Control") %>% pull(spin_reduction)
  d_male <- effsize::cohen.d(male_cbt, male_ctrl)$estimate
  cat(sprintf("Male CBT vs Control: d = %.2f\n", d_male))
  
  # Female: CBT vs Control
  female_cbt <- data %>% filter(gender=="Female", treatment=="CBT") %>% pull(spin_reduction)
  female_ctrl <- data %>% filter(gender=="Female", treatment=="Control") %>% pull(spin_reduction)
  d_female <- effsize::cohen.d(female_cbt, female_ctrl)$estimate
  cat(sprintf("Female CBT vs Control: d = %.2f\n", d_female))
  
} else {
  cat("\n✓ No significant interaction. Main effects can be interpreted directly.\n")
  
  # Post-hoc for main effects (if significant)
  emm_gender <- emmeans(anova_model, ~ gender)
  emm_treatment <- emmeans(anova_model, ~ treatment)
  
  cat("\n=== Main Effect Pairwise Comparisons ===\n")
  print(pairs(emm_gender, adjust="bonferroni"))
  print(pairs(emm_treatment, adjust="bonferroni"))
}

# === STEP 7: Visualize Results ===
# Bar plot with facets
ggplot(interaction_data, aes(x=treatment, y=M, fill=gender)) +
  geom_bar(stat="identity", position=position_dodge(0.9), width=0.8) +
  geom_errorbar(aes(ymin=M-SE, ymax=M+SE),
                position=position_dodge(0.9), width=0.2) +
  labs(title="Social Anxiety Reduction: Gender × Treatment Interaction",
       x="Treatment", y="Mean SPIN Reduction Score ± SE",
       fill="Gender") +
  scale_fill_brewer(palette="Set1") +
  theme_classic(base_size=14)

# === APA-Style Report ===
cat("
=== APA-STYLE RESULTS ===
A 2×2 between-subjects ANOVA examined the effects of gender(Male, Female) and 
treatment(CBT, Waitlist Control) on social anxiety reduction(SPIN scores). 
Data met assumptions of homogeneity of variance(Levene's test, p = .18) and 
normality of residuals(Shapiro-Wilk, p = .42). Cell sizes were balanced 
(n = 30 per cell).

Results revealed a significant main effect of treatment, F(1, 116) = 78.45, 
p < .001, partial η² = .40 (large effect), with CBT(M = 22.4, SD = 9.1) 
producing greater anxiety reduction than control(M = 4.0, SD = 7.3). The main 
effect of gender was not significant, F(1, 116) = 2.13, p = .15, partial η² = .02.

CRITICALLY, there was a significant Gender × Treatment interaction, 
F(1, 116) = 4.89, p = .029, partial η² = .04 (small-medium effect). Simple 
effects analysis revealed that CBT was effective for both genders, but the 
effect was larger for females(M = 26.3 vs 4.2, d = 2.61, p < .001) than males 
(M = 18.5 vs 3.8, d = 1.93, p < .001).

Conclusion: CBT significantly reduces social anxiety, with greater 
effectiveness for females than males, supporting gender-tailored interventions.
")
Interpretation Blueprint

Main effect of treatment: F(1, 116) = 78.45, p < .001, partial η² = .40 (large). Gender × Treatment interaction: F(1, 116) = 4.89, p = .029, partial η² = .04 (small-medium). CRITICAL: Interaction significant—main effects alone are misleading. Simple effects show CBT effective for both genders, but more so for females (d = 2.61) than males (d = 1.93). Findings suggest gender moderates CBT effectiveness for social anxiety, warranting tailored interventions.

05Tactical Pivots

Alternatives

Structured fallback pathways for choosing alternative tests when normality or slopes requirements fail.

When the path is blocked, pivot. Rigor is not rigidity; it is the intelligent adaptation to reality.
Adaptive Strategy
Measurement Precision Ladder Ideal · Ratio / Interval
Ratio
Maintain Factorial ANOVA. Identifies synergistic interactions with maximum mathematical rigor.
Peak Signal
Interval
Ideal for Factorial Outcomes. Ensure measurement units are consistent across the demographic grid.
Standard Precision
Ordinal
Pivot to Scheirer-Ray-Hare Test (Non-parametric Factorial) or Ordinal Logistic interaction models.
Rank Compression
Nominal
Abandon ANOVA. Use Log-Linear Analysis to audit interactions between multiple categorical variables.
Information Suicide
Temporal Trajectory Audit Static Factorial Grid
Static
Multi-group snapshot.
Stay with Two-Way ANOVA. The elite standard for detecting categorical synergy.
Repeated
Factor A or B is Time.
Pivot to Mixed ANOVA to account for the hybrid nature of grouping and temporal growth.
Double-Repeated
Both factors are Time.
Pivot to Two-Way Repeated Measures ANOVA for pure internal trajectory synergy.
Adaptive Technical Safeguards · adaptive safeguards
cell sparsity
  • Type III Sum of Squares — Mandate for unbalanced designs where cell N is unequal.
  • Bootstrap Interaction — Verify the stability of the synergy term across sampling fluctuations.
Unequal variances
  • Weighted Least Squares — Downweight noisy demographic cells to protect the interaction signal.
  • Robust Factorial GLM — Use M-estimators to neutralize the influence of cell-specific outliers.
Non-normal residuals
  • Permutation Factorial — Generate exact significance based on exhaustive group re-assignment.
06Adjusted Comparisons

Post-hoc

Group mean comparisons and correction controls (e.g. Tukey HSD, Bonferroni) to protect against Family-Wise Error Rates.

The omnibus test opens the door; post-hoc analysis explores the room.
Forensic Detail
Adjusted Comparisons

Post-hoc pairwise tests defined for this model.

Interpretation Guidelines

If interaction is significant, main effects are often misleading. Focus on simple effects and interaction interpretation.

07Standardized scale impact

Effect Size

Understanding effect sizes (e.g., Cohen's d, Partial Eta-Squared) and clinical impact benchmarks.

Eta-squared tells you the 'ownership' of variance. How much of the outcome does your treatment actually control?
Impact Magnitude

Proportion of variance in DV explained by each factor/interaction, removing variance from other factors. Small: .01, Medium: .06, Large: .14 (Cohen, 1988). MOST COMMONLY REPORTED for factorial ANOVA.

Less biased estimate of population effect size. Small: .01, Medium: .06, Large: .14. Preferred over η² for small samples.

Total proportion of variance explained (sum across all factors). Biased upward; use partial η² instead in factorial designs.

Standardized effect size for ANOVA. Small: 0.10, Medium: 0.25, Large: 0.40. Used in power analysis.

Recommended Metric: partial_eta_squared (partial η²) for main effects and interaction; Cohen's d or f for specific contrasts and simple effects
Small
0.2
Medium
0.5
Large
0.8
0.50
partial_eta_squared (partial η²) for main effects and interaction; Cohen's d or f for specific contrasts and simple effects
Recommended Measure
4
Available Metrics
ReportUse partial_eta_squared (partial η²) for main effects and interaction; Cohen's d or f for specific contrasts and simple effects to represent clinical impact magnitude.
08Statistical Power

Sample Size

Guidelines for minimum sample requirements and power analysis parameters.

An underpowered study is an ethical failure. Respect the data by collecting enough of it.
Power Protocol
Floor Requirements

The 'Cell Stability Mandate': A minimum of 15-20 participants per individual cell (e.g., Male-Treated) is essential. Factorial designs collapse mathematically if cell density is sparse.

Effect SizeParametersRequired n
Small Effectf=.10 (Small)n ≈ 787 total
Medium Effectf=.25 (Medium)n ≈ 128 total
Large Effectf=.40 (Large)n ≈ 52 total
Key considerations

In a factorial world, empty or sparse cells are the 'Silent Killers' of discovery. Prioritize group balance to protect the integrity of the interaction F-test. If cells are unbalanced, the Type III Sum of Squares is the only valid path.

G*Power StrategyBenchmark: F-tests → ANOVA: Fixed effects, special, main effects and interactions. Parameters: 2x2 Factorial, α = .05, Power = .80. Note: Detecting the 'Interaction' (Synergy) requires 4x more power than simple main effects.
09APA narrative blueprint

Reporting

How to compile statistical results into publication prose matching APA and journal style guides.

Report the F-statistic as the signal-to-noise ratio, showing how much of the variance is driven by treatment differences versus background noise.
Narrative Arc
Worked APA paragraph example
A 2×2 between-subjects ANOVA examined the effects of gender (Male, Female) and treatment (CBT, Waitlist Control) on social anxiety reduction (SPIN scores). Data met assumptions of homogeneity of variance (Levene's test, F(3, 116) = 1.65, p = .18) and normality (Shapiro-Wilk, p = .42). Results revealed a significant main effect of treatment, F(1, 116) = 78.45, p < .001, partial η² = .40 (large effect), with CBT producing greater anxiety reduction than control. The main effect of gender was not significant, F(1, 116) = 2.13, p = .15, partial η² = .02. Critically, there was a significant Gender × Treatment interaction, F(1, 116) = 4.89, p = .029, partial η² = .04 (small-medium effect). Simple effects analysis revealed that while CBT was effective for both genders (both p < .001), the effect was larger for females (M = 26.3, SD = 9.1) than males (M = 18.5, SD = 8.2), with Cohen's d = 2.61 and 1.93, respectively. These findings suggest that CBT effectiveness for social anxiety is moderated by gender, with greater benefits for females, supporting the development of gender-tailored interventions.
Reusable template

A two-way between-subjects ANOVA was conducted to examine the effects of Factor A: levels and Factor B: levels on DV. State design: 'The design was a [a × b factorial with balanced/unbalanced cell sizes (ns = list).'] Assumptions: 'Data met assumptions of homogeneity of variance (Levene's test, F(df1, df2) = X.XX, p = .XX) and normality of residuals (Shapiro-Wilk, p = .XX).' If violated, state corrections used. If unbalanced: 'Type III sums of squares were used due to unequal cell sizes.' Results revealed significant/non-significant main effects of Factor A, F(df1, df2) = X.XX, p = .XXX, partial η² = .XX interpret size, and Factor B, F(df1, df2) = X.XX, p = .XXX, partial η² = .XX. CRITICAL: State interaction result The Factor A × Factor B interaction was significant/non-significant, F(df1, df2) = X.XX, p = .XXX, partial η² = .XX. If interaction significant: 'The significant interaction indicates that the effect of [A depends on the level of B. Simple effects analysis was conducted...'] Describe simple effects results, pairwise comparisons, and interpretation in context. Conclude with practical significance and implications.

Essential statistics to report
  • F-statistics with df for BOTH main effects AND interaction
  • p-values for all three F-tests
  • Effect sizes (partial η²) for all effects
  • Cell means, SDs, and ns (often in table)
  • Statement about assumption checks (Levene's, normality)
  • Type of SS if unbalanced (Type II or III)
  • Simple effects results if interaction significant
  • Post-hoc pairwise comparisons with corrections
  • Interaction plot or cell means table
10Exhibit Builder

Manuscript Lab

Copy standard summary tables and forensic reporting grids to outline analysis details.

Table 1: Two-Way ANOVA Summary for Recovery Yield by Treatment and Severity
SourceType III SSdfMSFpηp²
Treatment (Main)15.4115.48.24.004.03
Severity (Main)112.8256.430.16< .001.20
Treatment × Severity42.1221.0511.26< .001.09
Error438.12341.87
Note. Type III Sum of Squares used to account for potential group imbalance. N = 240.
Interaction (F=11.26)This significant synergy proves the treatment effect depends on the baseline severity. Main effects cannot be interpreted in isolation.
ηp² (.20)Identifies Severity as the dominant driver of recovery, explaining 20% of the unexplained variance.
Header glossary

Identifies the Main Effects (individual factors) vs the Interaction (how factors work together).

The 'Pure' Variation. Calculates the unique variance slice owned by each factor after neutralizing all other overlaps.

Statistical Currency. Degrees of freedom spent to estimate each interaction and main effect.

Purified Variance. SS divided by df—the standardized metric for the Signal-to-Noise calculation.

The Multiplier. Measures how many times the effect outweighs random sampling error.

The Accident Probability. Probability of observing these differences if the true effect was zero. Target < .05.

The Relative Weight. The percentage of variance uniquely explained by this specific factor after removing error.

11Algorithmic Logic

Command Center

Syntax libraries and function parameters for executing calculations in stats packages.

Code is the modern laboratory. Clean execution ensures reproducible discovery.
Execution Engine
# 1. Fit Interaction Model
model <- lm(yield ~ treatment * severity, data = df)

# 2. Execute Type III Omnibus Audit
car::Anova(model, type = 3)

# 3. Visualize Synergy (Interaction Plot)
emmip(model, treatment ~ severity)
Library stack
R
caremmeansggplot2
Python
pingouinstatsmodels
Elite Forensic Strike

Isolate synergistic effects instantly while auditing for homoscedasticity across the factorial grid.

# Multi-point Diagnostic Dashboard
performance::check_model(model)

# Map Estimated Marginal Means (EMMs)
sjPlot::plot_model(model, type = 'int')
12The Over-adjustment Trap

Common Mistakes

Analytical caveats and corrections to maintain modeling integrity.

Wisdom is learning from the failures of others. Anticipate the error before it occurs.
Defensive Logic
Why it's wrong
When interaction is present, main effects are AVERAGES across levels of the other factor and can be misleading or meaningless. For example, if Factor A increases DV at one level of Factor B but decreases it at another, the main effect (average) could be zero, hiding the true pattern. Main effects ignore the conditional nature of effects revealed by interaction.
The correction
If interaction p < .05: (1) ALWAYS conduct simple effects analysis (effect of A at each level of B, or vice versa); (2) Interpret results in terms of the interaction pattern, not main effects; (3) Use interaction plots to visualize; (4) Report simple effects and pairwise comparisons within levels. Main effects can still be reported for completeness but should be interpreted cautiously with explicit mention of the interaction.
Why it's wrong
Type I SS is order-dependent: the first factor entered gets 'credit' for shared variance. With unbalanced designs, this creates bias. For example, if Factor A is entered first, it claims variance that might be shared with Factor B or the interaction. Results change if you swap factor order—scientifically arbitrary and misleading.
The correction
ALWAYS use Type III SS (default in car::Anova and most software) for factorial ANOVA, especially with unbalanced designs. Type III tests each effect controlling for all others, making it order-invariant and providing correct inference for main effects and interaction. Type II SS can be used if no interaction expected (tests main effects controlling for each other, not interaction).
Why it's wrong
Factorial ANOVA assumes equal variances across all Factor A × Factor B combinations (e.g., 4 cells in 2×2, 9 cells in 3×3), not just across levels of one factor. Heteroscedasticity inflates Type I error, especially for interaction tests and with unbalanced designs. Checking only marginal variances (Factor A or B separately) misses cell-specific heteroscedasticity.
The correction
Use Levene's test with the FULL factorial model (e.g., leveneTest(y ~ A * B)). If p < .05: (1) Transform DV (log, sqrt, Box-Cox); (2) Use generalized linear model (GLM) with appropriate variance structure; (3) Use heteroscedasticity-robust SEs (HC3); (4) Consider aligned rank transform for nonparametric factorial ANOVA. Be especially cautious with unbalanced designs + heteroscedasticity (double jeopardy).
Why it's wrong
Unbalanced designs complicate interpretation because main effect means are no longer simple averages—they're weighted by cell sizes. This can distort main effects and inflate Type I error for interaction, especially when combined with heteroscedasticity. Unbalance may also signal differential attrition or selection bias.
The correction
(1) Report cell sizes prominently; (2) Use Type III SS; (3) Investigate why design is unbalanced (random sampling variation vs systematic attrition); (4) Check if attrition is related to treatment/outcome (bias); (5) Ensure smallest cell has adequate sample size (n ≥ 15-20); (6) Check homogeneity of variance carefully; (7) Consider weighted least squares if variances differ systematically.
Why it's wrong
The interaction term tests whether factor effects are ADDITIVE (no interaction) or SYNERGISTIC/ANTAGONISTIC (interaction present). Omitting the interaction test assumes effects are additive, which may be false. Missing a true interaction loses scientifically important information—often the most interesting finding (e.g., treatment works for subgroup A but not B).
The correction
ALWAYS include the interaction term (factorA * factorB) in factorial ANOVA. Test it explicitly. If p < .05, interaction is present and should be interpreted. Even if you expect no interaction, test it empirically. If interaction is non-significant and theory supports additivity, you can interpret main effects. But never assume no interaction without testing.
Why it's wrong
Interaction F-tests tell you IF there's an interaction but not WHAT KIND (crossover, ordinal, spreading, etc.). Without plots, you can't see the pattern. Numeric tables of means are harder to interpret than visual representations. Interaction plots immediately reveal whether lines are parallel (no interaction), diverging (spreading), or crossing (crossover interaction with reversal).
The correction
ALWAYS create interaction plots: plot Factor B levels on x-axis, outcome on y-axis, with separate lines for Factor A levels (or vice versa). Non-parallel lines = interaction. Also useful: heatmaps of cell means, faceted plots, bar plots with error bars. Visualization aids interpretation and communication of findings.
Why it's wrong
Interaction effects are typically smaller than main effects and require larger samples to detect reliably. Small interactions (partial η² < .03) may be statistically significant with large N but practically trivial. Marginally significant interactions (p = .04) have high false positive risk, especially with multiple testing. Interactions are also vulnerable to Type M errors (magnitude exaggeration) when underpowered.
The correction
(1) Interpret interaction magnitude (effect size), not just p-value; (2) Consider practical/clinical significance—does the interaction change conclusions or recommendations? (3) Report confidence intervals for interaction effect; (4) Conduct sensitivity analyses (e.g., with/without outliers); (5) Seek replication before drawing strong conclusions; (6) Pre-register interaction hypotheses when possible.
Why it's wrong
Two-way between-subjects ANOVA assumes BOTH factors are between-subjects (independent groups). If one or both factors are within-subjects (repeated measures), you need different analyses (two-way RM-ANOVA or mixed ANOVA) that account for within-subject correlation. Using wrong test severely inflates Type I error (treats correlated observations as independent) and uses incorrect error terms.
The correction
Verify study design: (1) If BOTH factors are between-subjects (different participants in each cell) → two-way between-subjects ANOVA. (2) If ONE factor is between-subjects and one is within-subjects → mixed ANOVA. (3) If BOTH factors are within-subjects (repeated measures) → two-way repeated measures ANOVA. Use appropriate error terms and account for sphericity if within-subjects factors present.
13Academic Lineage

References

Scholarly lineage and citation keys grounding the statistical framework.

We stand on the shoulders of giants. Honor the source of the method.
Academic Lineage
[1]
Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences (2nd ed.). Lawrence Erlbaum Associates.
Classic reference for effect size interpretation (small/medium/large) and power analysis for factorial ANOVA. Cohen's f for two-way designs: small .10, medium .25, large .40.
[2]
Field, A. (2024). Discovering Statistics Using R (6th ed.). Sage Publications.
Comprehensive coverage of factorial ANOVA, interaction interpretation, simple effects, Type II/III SS, assumptions, and diagnostics. Chapter 13: Factorial Designs.
[3]
Maxwell, S. E., Delaney, H. D., & Kelley, K. (2018). Designing Experiments and Analyzing Data: A Model Comparison Perspective (3rd ed.). Routledge.
Authoritative treatment of factorial designs, contrast analysis, simple effects, and handling unbalanced designs. Emphasizes conceptual understanding through model comparison.
[4]
Keppel, G., & Wickens, T. D. (2004). Design and Analysis: A Researcher's Handbook (4th ed.). Pearson.
Detailed coverage of factorial ANOVA designs, error terms, interaction interpretation, and complex contrasts. Standard reference for experimental design.
[5]
Hofmann, S. G., Sawyer, A. T., Witt, A. A., & Oh, D. (2010). The effect of mindfulness-based therapy on anxiety and depression: A meta-analytic review. Journal of Consulting and Clinical Psychology, 78(2), 169-183.
Meta-analysis showing CBT effectiveness for anxiety with potential gender moderation (d = 0.59-0.97). Basis for Example 1.
doi: 10.1037/a0018555
[6]
Stern, Y. (2012). Cognitive reserve in ageing and Alzheimer's disease. The Lancet Neurology, 11(11), 1006-1012.
Cognitive reserve theory: education buffers age-related cognitive decline. Basis for Example 2 interaction (education × age on memory).
doi: 10.1016/S1474-4422(12)70191-6
[7]
Stults-Kolehmainen, M. A., & Sinha, R. (2014). The effects of stress on physical activity and exercise. Sports Medicine, 44(1), 81-121.
Exercise dose-response for cortisol reduction. Basis for Example 3 complex interaction patterns.
doi: 10.1007/s40279-013-0090-5
In a factorial world, Main Effects are often shadows. The true light of discovery is almost always found in the Interaction.
The Interpretive Rigor Directive
statminds · Two-WayMind reference · v2.2 · updated 2026-01-1715 of 15 sections