Atlas
statminds
Hybrid GLM (Three-Factor Complex Design)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

Three-Way Mixed ANOVA

The Grand Master of Clinical Designs. This model audits the complex interaction between one Between-Subjects grouping factor and two Within-Subjects repeated measures.

Model familyHybrid GLM (Three-Factor Complex Design)
Hypothesisomnibus
AliasesThree-Way Mixed-Factorial · Between-Within-Within ANOVA · The Triple Synergy Model
G1
Three-Way Synergy Audit
Detect if the 'Group x Time' recovery pattern is altered by a third context factor.
G2
Global Clinical Mapping
Chart the complete trajectory of treatment across multiple variables and demographics.
G3
Precision Stratification
Isolate the highest-order interaction to find the 'Ideal Responder' profile.
Visual Overview Dashboard
1

What is it?

Three-Way Mixed ANOVA analyzes outcomes across two independent between-subjects factors and one within-subjects repeated measure.

2

When to use it

  • 2 Between Factors: (e.g. Treatment and Gender).
  • 1 Within Factor: (e.g. Time [Pre vs Post]).
  • Outcome: Continuous scale variable.
3

Core Idea

It answers: Does the Treatment × Time interaction depend on Gender? This is represented as two side-by-side profile plots that differ in slope:

MALESFEMALES

A significant 3-way interaction indicates that the synergy between treatment and time manifests differently in males vs females.

4

Hypotheses

• Three Main Effects: A, B, C equal.
• Three 2-Way Interactions: AB, AC, BC equal.
• One 3-Way Interaction: ABC is null.
5

How it works

Partitions variance across multiple levels. Displays F-tests for all main effects (A, B, C), two-way interactions, and the critical three-way interaction.

6

Assumptions

👥 Group Independence: Between groups have no overlap.
🔮 Sphericity: Homogeneous within-subject variance.
⚖️ Homogeneity of Variances: Checked per cell.
7

Important Note

Three-way designs require substantial sample size. They are prone to low power for the interaction term ($A \times B \times C$).

8

Quick Example

Compare recovery (Pre vs Post) across active treatment vs placebo (Factor A), split by gender (Factor B) in a 2x2x2 clinical trial design.
Interactive Sandbox

Three-Way Mixed ANOVA Live Laboratory

Toggle main factors and the three-way interaction to see how three-way partitions affect outcomes.

Factor A (Treatment)0
Factor B (Gender)0
Factor C (Time Trend)5
3-Way Interaction (ABC)0
Noise (σ)8
Dual Trajectory Panels (Treatment vs Control)Y: outcome
MALES
PrePost
FEMALES
PrePost
Three-Way Mixed ANOVA Live Table
SourceSSdfFp-value
Factor A (Treatment)0.010.00p > 0.05
Factor B (Gender)0.010.00p > 0.05
Factor C (Time)250.013.91p > 0.05
ABC Interaction0.010.00p > 0.05
Three-Way Synergy Verdict
❌ No 3-Way Interaction
No three-way interaction. The Treatment × Time recovery profile is parallel across both male and female groups.
The 12-Stage Precision Workflow
01Triple Synergy
Hypotheses
We test the 'Holy Grail' of interactions: Group x Time x Condition—the ultimate indicator of context-dependent efficacy.
02Homogeneity Parity
Assumptions
Ensuring that variance consistency holds both across treatment groups and across the temporal/conditional repeated measures.
03Forensic Profiling
Diagnostics
Using high-fidelity interaction plots to visualize the 'Diverging Slopes' across three intersecting dimensions.
04Elite Trials
Examples
Auditing FlowMotion vs. Control (Group) over 12 weeks (Time) across different Sleep Durations (Condition).
05LMM Pivot
Alternatives
Pivoting to Linear Mixed Models (LMM) if the complexity of the design leads to excessive missing data or unbalanced cells.
06Strategic Decomposition
Post-hoc
Executing 'Simple-Simple Main Effects'—a surgical strike to explain exactly where the three-way interaction breaks down.
07Partial η²
Effect Size
Determining the relative impact of the three-way synergy vs. the lower-order effects on the total variance landscape.
08The Power Challenge
Sample Size
Accounting for the significant N required to detect a three-way interaction, which often demands larger cohorts than simpler designs.
09Hierarchical Logic
Reporting
Narrating the three-way result as the primary breakthrough, letting it dictate the interpretation of all subsequent data.
10High-Order Syntax
Software
Configuring the complex multi-factor grid in the environment, ensuring Type III Sum of Squares integrity.
11Cognitive Overload
Common Mistakes
Avoiding the 'Interaction Confusion' error—failing to properly decompose a significant 3-way effect into meaningful stories.
12Complex Lineage
References
Tracing the model back to the pioneers of experimental psychology and multi-site clinical trial methodology.
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₀: No main effects of factors and no interactions (all condition means are equal)

Alternative · Hₐ

Hₐ: At least one main effect or interaction is significant

Why it matters omnibus

Tests multiple hypotheses: 3 main effects (one per factor), 3 two-way interactions, and 1 three-way interaction. If any omnibus test is significant (p<α), follow-up with simple effects analysis or pairwise comparisons with appropriate corrections.

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
6
Assumptions
4
Critical / High Severity
How to check
Quick
Inspect variable type; create histograms to verify scale is not discrete/categorical. Check that DV has sufficient range and variability
Rigorous
Formal measurement scale validation; verify measurement units are truly interval/ratio with equal intervals between values. Assess floor/ceiling effects
If violated
If ordinal with limited categories (e.g., Likert 1-5) → use ordinal regression or nonparametric methods. If many ordinal levels (7+) and approximately interval-like → may proceed cautiously with mixed ANOVA (robust to mild violations). If binary outcome → use logistic mixed model (GLMM with binomial family). If count outcome → use Poisson/negative binomial GLMM
friedman
How to check
Quick
Design review: Check if any subject IDs appear in multiple between-subjects groups (should not). Look for clustering indicators (school, site, family IDs). Verify random assignment for between-subjects factors
Rigorous
Check intraclass correlation (ICC) for potential clustering beyond factors in model. Verify sampling design ensures independence. For experimental designs, verify randomization was properly executed
If violated
If additional clustering (e.g., students nested in schools) → use multilevel/hierarchical linear mixed model with random effects for clusters. If subjects are related (families, twins) → use LMM with family random effects. If pseudo-replication (multiple measurements incorrectly treated as independent subjects) → restructure data appropriately as repeated measures. Document clustering and use appropriate random effects structure
linear mixed model
How to check
Quick
Q-Q plots of residuals by key cells; histograms of overall residuals; check for severe skewness or heavy tails. With many cells, check overall residual distribution as proxy
Rigorous
Shapiro-Wilk test per cell (if n_cell ≥ 5; p>.05 desired) or on overall residuals. Anderson-Darling test. Check skewness (<|2|) and kurtosis (<|7|). Plot residuals vs. fitted values to detect patterns
If violated
If mild violation with balanced design and n≥20 per cell: Mixed ANOVA is robust via Central Limit Theorem; proceed with caution. If moderate-severe non-normality: (1) Transform DV (log for right-skew, sqrt for count-like, Box-Cox); (2) Use linear mixed model with REML (more robust); (3) Bootstrap confidence intervals; (4) For binary/count outcomes, use GLMM with appropriate family. Report transformation/approach used
linear mixed model
How to check
Quick
Levene's test on between-subjects factor levels (p>.05 indicates equal variances). Boxplots by between-subjects groups should show similar spread. Check ratio of largest to smallest variance (<3:1 acceptable)
Rigorous
Bartlett's test (sensitive to normality). Plot residuals vs. fitted values by between-subjects groups; check for funnel patterns. Formal: Fit model, extract residuals, test variance homogeneity across between-subjects levels
If violated
If Levene's p<.05: (1) Transform DV (log if variance increases with mean); (2) Use linear mixed model with heterogeneous variance structure (nlme::lme with weights argument); (3) Use robust standard errors (sandwich estimators); (4) Use Welch-type corrections for between-subjects comparisons. Do NOT use standard F-tests without correction. Report variance heterogeneity and corrections applied
How to check
Quick
Mauchly's test of sphericity for each within-subjects factor and interaction (p>.05 indicates sphericity). SPSS/R output provides Mauchly's W statistic automatically in repeated measures ANOVA
Rigorous
Mauchly's test; if violated, check epsilon (ε) values: Greenhouse-Geisser ε (conservative), Huynh-Feldt ε (liberal). If ε < .75, sphericity seriously violated. Examine covariance matrix of within-subjects measures; check if variances of all pairwise differences are similar
If violated
If Mauchly's p<.05 (sphericity violated): (1) REQUIRED: Apply Greenhouse-Geisser correction (conservative; use if ε<.75) or Huynh-Feldt correction (less conservative; use if ε>.75) to adjust degrees of freedom and p-values; (2) BETTER: Use multivariate approach (MANOVA) which doesn't assume sphericity; (3) BEST: Use linear mixed model which flexibly models covariance structure without sphericity assumption. NEVER report uncorrected F-tests when Mauchly's p<.05. Always report ε and corrected p-values
linear mixed model
How to check
Quick
Boxplots by key factor combinations; identify values >1.5 IQR beyond quartiles. Check for extreme standardized residuals (|z|>3) in overall residuals
Rigorous
Studentized residuals (|r|>3 suspect); Cook's distance (D>4/n); leverage (hat values >2p/n); DFFITS. Influence plots. Examine outliers in context: data errors vs. legitimate extreme values
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 methods (M-estimators, trimmed means); (3) Winsorize to 5th/95th percentiles (pre-specify); (4) Transform DV if outliers due to skewness; (5) Use linear mixed model which is more robust to outliers than traditional ANOVA. Never remove outliers solely to achieve p<.05; document all decisions transparently
linear mixed model
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. Mauchly's test of sphericity for each within-subjects factor and interaction
  2. Levene's test for homogeneity of variance across between-subjects factor levels
  3. Q-Q plots of residuals to assess normality
  4. Interaction plots to visualize factor combinations
  5. Greenhouse-Geisser or Huynh-Feldt epsilon (ε) values if sphericity violated
Recommended checks
  1. Boxplots by factor combinations to identify outliers
  2. Residuals vs. fitted values plot to check homoscedasticity
  3. Profile plots for each factor to visualize main effects and interactions
  4. Descriptive statistics (M, SD, n) for each cell
  5. Cook's distance to identify influential cases
  6. Simple effects analysis if significant interactions
  7. Effect size plots (means with 95% CI by factor combination)
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

Clinical Trial with Treatment × Time × Gender (2×3×2 Mixed Design)

Research question: Does a new psychotherapy treatment reduce depression over time, and does effectiveness differ by gender? Design: 2 (Treatment: CBT vs. Control, between) × 3 (Time: Baseline, 8-week, 16-week, within) × 2 (Gender: Male vs. Female, between). Outcome: Beck Depression Inventory-II (BDI-II) score (continuous, 0-63, higher=more depression). Sample: 120 participants (60 CBT, 60 Control; balanced by gender). Hypothesis: Significant Treatment × Time interaction (CBT shows greater reduction than Control), possibly moderated by Gender (three-way interaction).

Design2 (Treatment: between) × 3 (Time: within) × 2 (Gender: between)
Outcome ScaleBDI-II depression score (0-63)
# Three-way Mixed ANOVA: Treatment (between) × Time (within) × Gender (between)
# Clinical depression study: CBT effectiveness over time by gender

library(ez)          # ezANOVA for mixed designs
library(afex)        # Alternative mixed ANOVA
library(emmeans)     # Marginal means and contrasts
library(ggplot2)
library(dplyr)
library(tidyr)
library(car)         # Levene's test

# Simulate realistic clinical trial data
set.seed(2025)
n_per_cell <- 30  # 30 per Treatment×Gender combination
time_points <- c("Baseline", "Week8", "Week16")

# Create between-subjects design (Treatment × Gender)
data_between <- expand.grid(
  treatment = c("CBT", "Control"),
  gender = c("Male", "Female")
) %>%
  slice(rep(1:n(), each=n_per_cell)) %>%
  mutate(
    subject_id = 1:n(),
    # Baseline random intercepts (individual differences)
    baseline_bdi = rnorm(n(), mean=28, sd=8),
    baseline_bdi = pmax(10, pmin(50, baseline_bdi))  # Constrain
  )

# Generate longitudinal data (repeated measures on Time)
data_long <- data_between %>%
  crossing(time = factor(time_points, levels=time_points)) %>%
  mutate(
    time_numeric = as.numeric(time) - 1,  # 0, 1, 2
    
    # True model effects:
    # Treatment effect: CBT reduces by -6 pts per timepoint vs. -2 for Control
    # Gender effect: Females start 3 pts higher but no interaction
    # Individual variation: ICC ~0.65
    
    treatment_effect = ifelse(treatment == "CBT", -6, -2),
    gender_effect = ifelse(gender == "Female", 3, 0),
    
    # BDI = Baseline + Gender + Treatment×Time + random_error
    bdi_score = baseline_bdi + gender_effect + 
                treatment_effect * time_numeric +
                rnorm(n(), mean=0, sd=5),  # Within-subject error
    bdi_score = pmax(0, pmin(63, bdi_score))
  ) %>%
  select(subject_id, treatment, gender, time, bdi_score)

# Convert to factors
data_long$subject_id <- factor(data_long$subject_id)
data_long$treatment <- factor(data_long$treatment)
data_long$gender <- factor(data_long$gender)
data_long$time <- factor(data_long$time, levels=time_points)

cat("=== Data Structure ===")
cat("\nTotal participants:", length(unique(data_long$subject_id)))
cat("\nTotal observations:", nrow(data_long))
cat("\nDesign: 2 (Treatment) × 3 (Time) × 2 (Gender)\n")

# Descriptive statistics
cat("\n=== Descriptive Statistics ===")
desc_stats <- data_long %>%
  group_by(treatment, gender, time) %>%
  summarise(
    n = n(),
    M = mean(bdi_score),
    SD = sd(bdi_score),
    .groups = 'drop'
  )
print(desc_stats, n=12)

# === STEP 1: Check Assumptions ===

cat("\n\n=== ASSUMPTION CHECKS ===")

# 1. Normality of residuals
# Fit preliminary model to get residuals
model_prelim <- aov(bdi_score ~ treatment * gender * time + 
                    Error(subject_id/time), data=data_long)
residuals_long <- residuals(lm(bdi_score ~ treatment * gender * time, data=data_long))

cat("\n1. Normality of Residuals")
shapiro_test <- shapiro.test(sample(residuals_long, min(5000, length(residuals_long))))
cat("\n   Shapiro-Wilk: W=", round(shapiro_test$statistic, 4), 
    ", p=", round(shapiro_test$p.value, 3))
cat(ifelse(shapiro_test$p.value > 0.05, " ✓", " ⚠"), "\n")

par(mfrow=c(1,2))
qqnorm(residuals_long, main="Q-Q Plot: Residuals")
qqline(residuals_long, col="red", lwd=2)
hist(residuals_long, breaks=30, main="Histogram: Residuals", 
     xlab="Residuals", col="lightblue")

# 2. Homogeneity of variance (between-subjects factors)
cat("\n2. Homogeneity of Variance(Between-Subjects)")
levene_test <- leveneTest(bdi_score ~ treatment * gender, 
                          data=filter(data_long, time=="Baseline"))
cat("\n   Levene's test: F=", round(levene_test$`F value`[1], 3),
    ", p=", round(levene_test$`Pr(>F)`[1], 3))
cat(ifelse(levene_test$`Pr(>F)`[1] > 0.05, " ✓", " ⚠"), "\n")

par(mfrow=c(1,1))
boxplot(bdi_score ~ treatment * gender, 
        data=filter(data_long, time=="Baseline"),
        main="BDI by Treatment × Gender(Baseline)",
        xlab="Group", ylab="BDI-II Score", col=c("lightblue", "lightpink"))

# 3. Sphericity (within-subjects factor: Time)
cat("\n3. Sphericity(Within-Subjects Factor: Time)")
cat("\n   Note: Sphericity tested automatically in ezANOVA output below")
cat("\n   If Mauchly's p<.05 → use Greenhouse-Geisser or Huynh-Feldt correction\n")

# === STEP 2: Run Three-way Mixed ANOVA ===

cat("\n\n=== THREE-WAY MIXED ANOVA ===")

# Using ezANOVA (automatically tests sphericity and provides corrections)
anova_result <- ezANOVA(
  data = data_long,
  dv = bdi_score,
  wid = subject_id,
  within = time,
  between = .(treatment, gender),
  type = 3,
  detailed = TRUE,
  return_aov = TRUE
)

print(anova_result$ANOVA)

cat("\n=== Sphericity Tests(Mauchly's) ===")
if(!is.null(anova_result$`Mauchly's Test for Sphericity`)) {
  print(anova_result$`Mauchly's Test for Sphericity`)
  cat("\nIf p<.05, sphericity violated → use corrections below\n")
}

cat("\n=== Sphericity Corrections ===")
if(!is.null(anova_result$`Sphericity Corrections`)) {
  print(anova_result$`Sphericity Corrections`)
  cat("\nGreenhouse-Geisser(GGe): Conservative correction(use if ε<.75)")
  cat("\nHuynh-Feldt(HFe): Less conservative(use if ε>.75)\n")
}

# === STEP 3: Interpret Main Effects and Interactions ===

cat("\n\n=== INTERPRETATION OF RESULTS ===")

cat("\n1. MAIN EFFECT OF TREATMENT(between-subjects):")
cat("\n   Tests if CBT differs from Control averaged across Time and Gender")
cat("\n   If p<.05 → CBT and Control differ overall\n")

cat("\n2. MAIN EFFECT OF TIME(within-subjects):")
cat("\n   Tests if depression changes over time(averaged across Treatment and Gender)")
cat("\n   If p<.05 → Significant change from Baseline to Week 8 to Week 16")
cat("\n   Check sphericity correction! Use GG or HF p-value if Mauchly's p<.05\n")

cat("\n3. MAIN EFFECT OF GENDER(between-subjects):")
cat("\n   Tests if Males differ from Females averaged across Time and Treatment")
cat("\n   If p<.05 → Gender difference in overall depression levels\n")

cat("\n4. TREATMENT × TIME INTERACTION(critical for efficacy):")
cat("\n   Tests if rate of change over time differs between CBT and Control")
cat("\n   If p<.05 → CBT shows different trajectory than Control(expected!)")
cat("\n   This is the PRIMARY hypothesis in treatment trials\n")

cat("\n5. TREATMENT × GENDER INTERACTION:")
cat("\n   Tests if treatment effectiveness differs by gender(averaged over time)")
cat("\n   If p<.05 → CBT works better for one gender than the other\n")

cat("\n6. TIME × GENDER INTERACTION:")
cat("\n   Tests if rate of change over time differs by gender")
cat("\n   If p<.05 → Males and Females show different trajectories\n")

cat("\n7. TREATMENT × TIME × GENDER(three-way interaction):")
cat("\n   Tests if Treatment×Time interaction is moderated by Gender")
cat("\n   If p<.05 → CBT's time trajectory differs by gender(e.g., CBT works faster for females)")
cat("\n   Requires simple effects analysis to interpret\n")

# === STEP 4: Visualize Interactions ===

cat("\n\n=== VISUALIZATION ===")

# Interaction plot: Treatment × Time by Gender
interaction_means <- data_long %>%
  group_by(treatment, gender, time) %>%
  summarise(M = mean(bdi_score), 
            SE = sd(bdi_score)/sqrt(n()),
            .groups='drop')

ggplot(interaction_means, aes(x=time, y=M, color=treatment, group=treatment)) +
  geom_line(size=1.2) +
  geom_point(size=3) +
  geom_errorbar(aes(ymin=M-1.96*SE, ymax=M+1.96*SE), width=0.1) +
  facet_wrap(~gender) +
  labs(title="Three-way Interaction: Treatment × Time × Gender",
       subtitle="Mean BDI-II Score ± 95% CI",
       x="Time Point", y="Depression(BDI-II)",
       color="Treatment") +
  theme_classic() +
  theme(legend.position="bottom") +
  scale_color_manual(values=c("CBT"="#2E86AB", "Control"="#A23B72"))

# Profile plot: Emphasize Treatment × Time interaction
ggplot(interaction_means, aes(x=time, y=M, color=treatment, linetype=gender, group=interaction(treatment, gender))) +
  geom_line(size=1.2) +
  geom_point(size=3) +
  labs(title="Depression Trajectory by Treatment, Time, and Gender",
       x="Time Point", y="Mean BDI-II Score",
       color="Treatment", linetype="Gender") +
  theme_classic()

# === STEP 5: Post-hoc Tests (if interactions significant) ===

cat("\n\n=== POST-HOC TESTS: Simple Effects Analysis ===")

# If Treatment×Time interaction is significant, test simple effects:
# Effect of Treatment at each Time point

cat("\nSimple effects: Effect of Treatment at each Time point\n")

emm <- emmeans(anova_result$aov, ~ treatment | time)
pairs_time <- pairs(emm, adjust="bonferroni")
print(pairs_time)

cat("\nInterpretation: Compare CBT vs. Control at Baseline, Week 8, Week 16")
cat("\nExpected: No difference at Baseline(randomization); CBT<Control at Weeks 8 & 16\n")

# Effect of Time within each Treatment
cat("\n\nSimple effects: Effect of Time within each Treatment\n")

emm_time <- emmeans(anova_result$aov, ~ time | treatment)
pairs_treatment <- pairs(emm_time, adjust="bonferroni")
print(pairs_treatment)

cat("\nInterpretation: Test if depression changes over time within CBT and Control separately")
cat("\nExpected: Significant decline in CBT; smaller/no decline in Control\n")

# === STEP 6: Effect Sizes ===

cat("\n\n=== EFFECT SIZES ===")

# Partial eta-squared from ezANOVA output
cat("\nPartial η² for each effect(from ANOVA table above)")
cat("\nInterpretation: .01=small, .06=medium, .14=large(Cohen, 1988)\n")

# Calculate effect size for key comparison: CBT vs. Control at Week 16
week16_data <- filter(data_long, time=="Week16")
cbt_16 <- filter(week16_data, treatment=="CBT")$bdi_score
control_16 <- filter(week16_data, treatment=="Control")$bdi_score

cohens_d <- (mean(cbt_16) - mean(control_16)) / 
            sqrt((var(cbt_16) + var(control_16)) / 2)

cat("\nCohen's d(CBT vs. Control at Week 16):", round(cohens_d, 2))
cat("\nInterpretation: .2=small, .5=medium, .8=large")
cat("\nExpected d ~ -0.6 to -0.8 (negative = CBT lower depression)\n")

# === APA-Style Reporting ===

cat("\n\n=== APA-STYLE REPORT ===")
cat("
A three-way mixed ANOVA was conducted to examine the effects of treatment 
(CBT vs. Control, between-subjects), time(Baseline, 8-week, 16-week, within-subjects), 
and gender(Male vs. Female, between-subjects) on depression severity(BDI-II scores). 
The sample included 120 participants(30 per Treatment×Gender combination) measured 
at three time points(N=360 observations).

Assumptions were evaluated: Normality of residuals was satisfactory(Shapiro-Wilk p>.05). 
Levene's test indicated homogeneity of variance for between-subjects factors(p=.XX). 
Mauchly's test of sphericity was [non-significant/significant] for the Time factor 
(W=.XX, p=.XX); [no correction was needed / Greenhouse-Geisser correction was applied 
with ε=.XX].

Results revealed a significant three-way interaction [F(2, 232)=X.XX, p=.XXX, 
partial η²=.XX] OR [The three-way interaction was not significant, F(2, 232)=X.XX, p=.XX]. 
The critical Treatment×Time interaction was significant [F(2, 232)=XX.XX, p<.001, 
partial η²=.XX, large effect], indicating that CBT and Control groups showed different 
trajectories over time. 

Simple effects analysis revealed that at baseline, CBT and Control did not differ 
(p=.XX), confirming successful randomization. At Week 8, CBT showed significantly 
lower depression than Control(M_CBT=XX.X, M_Control=XX.X, p<.001, d=X.XX). This 
difference increased by Week 16 (M_CBT=XX.X, M_Control=XX.X, p<.001, d=X.XX), 
demonstrating sustained and increasing treatment efficacy.

[If gender moderation:] The Treatment×Time×Gender interaction was significant(p=.XX), 
indicating that treatment trajectories differed by gender. Post-hoc analysis showed that 
[describe pattern].

Main effects: Time showed a significant main effect(F(2, 232)=XX.XX, p<.001, 
partial η²=.XX), indicating overall decrease in depression across time points. 
Treatment showed a significant main effect(F(1, 116)=XX.XX, p<.001, partial η²=.XX), 
with CBT participants showing lower overall depression than Controls. [Gender main 
effect results].

These findings support CBT as an effective treatment for depression, with therapeutic 
benefits emerging by 8 weeks and strengthening through 16 weeks(Cohen's d=-0.XX, 
large effect). Results are consistent with meta-analytic estimates of CBT efficacy 
(Cuijpers et al., 2016).
")

cat("\n\n=== KEY REPORTING ELEMENTS ===")
cat("
✓ Design clearly specified(2×3×2 mixed)
✓ Sample size and cell sizes reported
✓ Assumption checks reported(normality, homogeneity, sphericity)
✓ Sphericity corrections applied if needed(GG or HF)
✓ All main effects and interactions reported with F, df, p, partial η²
✓ Simple effects analysis for significant interactions
✓ Effect sizes for key comparisons(Cohen's d)
✓ Means, SDs, and confidence intervals for key cells
✓ Interpretation linked to research question and literature
")
Interpretation Blueprint

Treatment×Time interaction F(2,232)=45.3, p<.001, partial η²=.28 (large effect): CBT shows significantly steeper decline (−6 pts/timepoint) than Control (−2 pts/timepoint). At Week 16, Cohen's d=−0.75 (large effect), with CBT participants scoring 13.8 points lower than Controls. Three-way interaction not significant (p=.42), indicating treatment effectiveness does not differ by gender. Main effect of Time: F(2,232)=78.2, p<.001, ε=.94 (sphericity satisfied). Findings demonstrate robust CBT efficacy consistent with meta-analyses showing d=0.6-0.8 for depression treatment (Cuijpers et al., 2016).

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 Three-Way Mixed ANOVA. Essential for complex RCTs auditing Group x Time x Condition interaction.
Peak Signal
Interval
Ideal for clinical outcomes. Ensure the triple-interaction doesn't collapse due to measurement noise at specific levels.
Standard Precision
Ordinal
Pivot to Multi-level Ordinal GEE to maintain trend detection across ranked categories in three dimensions.
Rank Compression
Nominal
Abandon ANOVA. Use Multi-Way Log-Linear Analysis to audit the hierarchy of categorical associations.
Information Suicide
Temporal Trajectory Audit Triple-Factor Hybrid
Multi-Level RM
2 Within, 1 Between.
Stay with Three-Way Mixed ANOVA. The standard for multi-timepoint, multi-condition clinical trials.
Sparse Grid
Missing cell data.
Pivot to Linear Mixed Models (LMM). GLM-based ANOVA cannot handle empty cells in a 3-way interaction.
Longitudinal Clustering
Random visit windows.
Pivot to LMM with random slopes to account for the unique 'Pulse' of each site or participant.
Adaptive Technical Safeguards · adaptive safeguards
triple sphericity failure
  • REML Correction — Use Restricted Maximum Likelihood within an LMM framework to model complex covariance matrices.
  • MANOVA Strike — Treat the temporal/conditional levels as a multivariate vector to avoid sphericity bias.
Unequal variances
  • Robust Standard Errors (Sandwich) — Protect the between-subjects group comparisons from site-specific noise.
  • Weighting Strategy — Adjust for unequal variances across the 3-way cells.
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

For three-way interactions, conduct simple effects analysis: Test two-way interaction at each level of third factor, then proceed to pairwise comparisons. Always correct for multiple comparisons to control familywise error rate.

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 attributable to effect, excluding variance from other effects. Small: .01, Medium: .06, Large: .14 (Cohen, 1988). MOST COMMON in mixed ANOVA.

Proportion of total variance (including between-subjects variance). More appropriate for designs with both between and within factors. Provides comparable effect sizes across designs.

Standardized mean difference for pairwise comparisons. Small: .2, Medium: .5, Large: .8. Calculate for key simple effects.

Less biased than η²; estimates population effect size. Interpretation same as η².

Recommended Metric: Partial η² for omnibus effects (from ANOVA table); Cohen's d for specific pairwise comparisons (e.g., treatment vs. control at final timepoint)
Small
0.2
Medium
0.5
Large
0.8
0.50
Partial η² for omnibus effects (from ANOVA table); Cohen's d for specific pairwise comparisons (e.g., treatment vs. control at final timepoint)
Recommended Measure
4
Available Metrics
ReportUse Partial η² for omnibus effects (from ANOVA table); Cohen's d for specific pairwise comparisons (e.g., treatment vs. control at final timepoint) 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

At least 20 participants per between-subjects cell for adequate power and assumption robustness (e.g., 2×2 between design needs ≥80 total)

Effect SizeParametersRequired n
Small Effectf=.10n≈200 total
Medium Effectf=.25n≈60 total
Large Effectf=.40n≈28 total
Key considerations

Power for three-way interaction is typically lower than for main effects or two-way interactions. If three-way interaction is critical hypothesis, increase sample size by 30-50%. Account for attrition in longitudinal within-subjects factors (assume 10-20% dropout). Balanced designs (equal n per cell) maximize power and robustness.

G*Power StrategyUse G*Power: F-tests → ANOVA: Repeated measures, within-between interaction. Input: f effect size, α, power, number of groups, number of measurements, correlation among repeated measures (estimate .50-.70), nonsphericity correction (ε, typically .75-1.0)
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 (Treatment: CBT vs. Control, between-subjects) × 3 (Time: Baseline, 8-week, 16-week, within-subjects) × 2 (Gender: Male vs. Female, between-subjects) mixed ANOVA examined depression severity (BDI-II scores). The sample included 120 participants (30 per Treatment×Gender cell) measured at three time points (N=360 observations). Assumptions were met: Residuals were normally distributed (Shapiro-Wilk p=.12), Levene's test indicated homogeneity of variance (p=.28), and Mauchly's test showed sphericity was satisfied for Time (W=.94, p=.08). Results revealed a significant Treatment×Time interaction, F(2, 232)=45.32, p<.001, partial η²=.28 (large effect), indicating that CBT and Control groups showed different trajectories over time. The three-way interaction was not significant, F(2, 232)=1.73, p=.18, partial η²=.01, suggesting treatment effectiveness did not vary by gender. Simple effects analysis showed that at baseline, CBT and Control did not differ (p=.82), but by Week 8, CBT showed significantly lower depression (M=16.4, SD=5.2) than Control (M=24.1, SD=6.1), t(118)=6.8, p<.001, d=1.35, with this difference maintained at Week 16 (M_CBT=10.5, M_Control=24.3, d=2.14). Main effects were significant for Time, F(2, 232)=78.15, p<.001, partial η²=.40, Treatment, F(1, 116)=52.30, p<.001, partial η²=.31, but not Gender, F(1, 116)=2.10, p=.15. These findings support CBT as highly effective for depression reduction across 16 weeks, with therapeutic benefits emerging by Week 8 and strengthening through Week 16, consistent with meta-analytic evidence (Cuijpers et al., 2016). Treatment effectiveness was equivalent for males and females.
Reusable template

A three-way mixed ANOVA was conducted to examine the effects of between-factor 1 (levels, between-subjects), within-factor (levels, within-subjects), and between-factor 2 (levels, between-subjects) on DV. The sample included N participants (n per cell per between-factors combination) measured at k time points (N=total observations observations). Describe design: e.g., '2×3×2 mixed design with one repeated measure'. Assumptions were evaluated: Report normality, homogeneity of variance for between-subjects factors with Levene's test, sphericity for within-subjects factors with Mauchly's test. If sphericity violated: Mauchly's test indicated sphericity was violated for factor/interaction (W=.XX, p=.XX), so Greenhouse-Geisser/Huynh-Feldt correction was applied (ε=.XX). Results revealed report three-way interaction first if significant, then two-way interactions, then main effects. For significant three-way interaction: The three-way interaction was significant, F(df1, df2)=X.XX, p=.XXX, partial η²=.XX interpret effect size, indicating that describe pattern. Simple effects analysis showed describe key patterns. For two-way interactions: The Factor A × Factor B interaction was significant, F(df1, df2)=X.XX, p<.001, partial η²=.XX interpret, indicating pattern. Post-hoc tests using method revealed specific comparisons with p-values and effect sizes. Main effects: Main effects were found for list factors with F, df, p, η². Conclude with interpretation: These findings interpret in context of research question and literature.

Essential statistics to report
  • F-statistic for each main effect and interaction
  • Degrees of freedom (numerator and denominator)
  • p-value
  • Effect size (partial η² for omnibus, Cohen's d for pairwise)
  • Descriptive statistics per cell (M, SD, n)
  • Sphericity tests (Mauchly's W, p-value, ε) and corrections applied
  • Levene's test for between-subjects homogeneity
  • Post-hoc test results with adjusted p-values for significant effects
  • Confidence intervals for key comparisons
  • Statement about assumption checks
10Exhibit Builder

Manuscript Lab

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

Table 1: Three-Way Mixed ANOVA Summary for Cognitive Scores
SourcedfMSFpηp²
Group (Between)1145.24.12.045.04
Gender (Between)112.40.35.556.00
Time (Within)1.8210.535.21< .001.24
Group × Time1.845.17.54.002.06
Group × Gender × Time1.838.26.40.004.05
Error (Within)208.25.9
Note. Factors: Group (Control/Exp) × Gender (M/F) × Time (Pre/Post/Follow-up). N = 120.
Group × Gender × Time (p=.004)A significant 3-way interaction overrides all lower-level effects. It means 'The treatment works differently over time for Men vs. Women'. You must decompose this before concluding efficacy.
Time (ηp² = .24)Regardless of group or gender, the passage of time drove the largest shifts in cognitive scores (24% variance explained).
Header glossary

The 'Contextual Efficacy' Audit. Determines if the treatment's success over time depends on the gender of the participant.

Sphericity Correction. Indicates degrees of freedom were penalized (Greenhouse-Geisser) to correct for correlated error terms.

Partial Eta-Squared. The magnitude of the specific interaction effect, isolated from other design factors.

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. Execute 3-Way Mixed ANOVA
model <- aov_ez(id = 'subject', dv = 'score', data = df, 
                between = c('group', 'gender'), within = 'time')

# 2. Decompose the 3-Way Interaction (Simple Effects)
joint_tests(model, by = 'gender')

# 3. Visualize the 'Split' Trajectories
emmip(model, group ~ time | gender)
Library stack
R
afexemmeansggplot2
Python
pingouinseaborn
Elite Forensic Strike

When a 3-Way interaction is significant, stop looking at main effects. Pivot immediately to 'Simple Simple Main Effects'.

# Diagnostic Audit
performance::check_model(model)

# The 'Slice' Analysis (Simple Simple Effects)
emmeans(model, ~ group * time | gender) %>% 
  contrast(interaction = 'pairwise')
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 sphericity is violated (Mauchly's p<.05), the F-test for within-subjects effects is invalid—it becomes too liberal (inflated Type I error). The assumption of equal variances of differences between all pairs of within-subjects levels is violated, distorting the F-distribution. Using uncorrected F-tests can lead to false positives.
The correction
ALWAYS check Mauchly's test. If p<.05, REQUIRED: Apply Greenhouse-Geisser correction (if ε<.75, conservative) or Huynh-Feldt correction (if ε≥.75, less conservative) to adjust degrees of freedom. Better: Use MANOVA approach (doesn't assume sphericity) or LMM (flexible covariance structures). Report: 'Mauchly's test indicated sphericity was violated (W=.73, p=.02), so Greenhouse-Geisser correction was applied (ε=.81, F_corrected(1.62, 188.0)=23.4, p<.001).' NEVER report uncorrected within-subjects F-test when Mauchly's p<.05.
Why it's wrong
A significant three-way interaction (e.g., Treatment×Time×Gender) indicates that a two-way interaction (e.g., Treatment×Time) differs across levels of a third factor (Gender). Simply reporting 'three-way interaction significant' without follow-up is uninformative and scientifically incomplete. Readers cannot understand the nature of the interaction or which specific comparisons drive the effect.
The correction
For significant three-way interactions, conduct simple effects analysis: (1) Test two-way interaction at each level of third factor (e.g., Treatment×Time interaction separately for Males and Females); (2) Then test simple simple effects (e.g., Treatment effect at each Time within each Gender); (3) Apply appropriate corrections for multiple comparisons (Bonferroni, Holm, FDR). Use emmeans in R: emm<-emmeans(model, ~treatment*time|gender); pairs(emm, adjust='bonferroni'). Report specific patterns with effect sizes: 'Simple effects showed Treatment×Time interaction was significant for Females (F=18.3, p<.001) but not Males (F=2.1, p=.13).'
Why it's wrong
Running separate ANOVAs (e.g., one for CBT group, one for Control group) inflates Type I error, loses power, and cannot test interactions. Testing Treatment×Time interaction requires joint analysis. Separate tests cannot properly control familywise error rate. Additionally, pooled error term in mixed ANOVA provides better power than separate error terms.
The correction
Use three-way mixed ANOVA with all factors included simultaneously. This allows proper testing of interactions and controls familywise error. If software limitations exist, use linear mixed model (LMM): lmer(outcome ~ treatment*time*gender + (1|subject_id)) which is more flexible and handles missing data better. Report: 'A three-way mixed ANOVA was conducted...' not 'Separate repeated measures ANOVAs were conducted for each treatment group...'
Why it's wrong
p-values indicate statistical significance but not practical importance. With large samples, tiny trivial effects can be 'significant' (p<.05). Effect sizes answer: 'How large is the effect?' and 'Is it meaningful?' Critical for meta-analyses, replication, and interpretation. APA guidelines require effect sizes for all inferential tests.
The correction
ALWAYS report partial η² for all omnibus effects (main effects, interactions) with interpretation: 'partial η²=.28 (large effect, explaining 28% of variance)'. For key pairwise comparisons, report Cohen's d: 'd=0.75 (large effect)'. Report confidence intervals when possible: '95% CI [0.52, 0.98]'. Include interpretation: small (.01/.2), medium (.06/.5), large (.14/.8) for η²/d respectively. Example: 'Treatment×Time interaction, F(2,232)=45.3, p<.001, partial η²=.28 (large effect).' Never report 'p<.05' without effect size.
Why it's wrong
Within-subjects effects have different df than between-subjects effects. Within-subjects df depend on (k-1) × (n-g) where k=levels of within factor, n=total subjects, g=between-groups. Incorrect df leads to wrong p-values and invalid inferences. Common when manually calculating or using wrong software settings.
The correction
Use software that correctly computes mixed ANOVA df (ezANOVA, afex, SPSS GLM Repeated Measures, pingouin). Verify: Between-subjects effects have df_denom = (n - g), where g=number of between-groups. Within-subjects effects have df_denom = (k-1)×(n-g). Example: 2×3×2 design with n=120, between-groups g=4 (2×2), Time has 3 levels → df_Time = (3-1, (3-1)×(120-4)) = (2, 232). Always check df in output against expected values. Report df correctly: 'F(2, 232)=45.3' not 'F(2, 118)=...'.
Why it's wrong
Mixed ANOVA assumes equal variances across between-subjects groups (like one-way ANOVA). Violation (heteroscedasticity) distorts F-tests, inflates Type I error (if smaller groups have larger variance) or reduces power. Ignoring this assumption can lead to invalid conclusions about between-subjects effects and interactions involving between-subjects factors.
The correction
Test homogeneity with Levene's test on between-subjects factor combinations (use baseline or residuals from full model): leveneTest(outcome ~ treatment*gender, data=baseline_data). If p<.05 (violated): (1) Transform DV (log if variance∝mean), (2) Use LMM with heterogeneous variance structure (weights=varIdent(form=~1|group) in nlme), or (3) Use robust standard errors. Report: 'Levene's test indicated homogeneity of variance (F(3,116)=1.8, p=.15)' or 'Levene's test showed unequal variances (p=.02), so linear mixed model with heterogeneous variance structure was used.' Never ignore Levene's p<.05.
Why it's wrong
Partial η² in mixed ANOVA partials out variance from OTHER effects but includes between-subjects variance for within-subjects effects and vice versa. This makes direct comparison of partial η² between within-subjects and between-subjects effects misleading—within-subjects effects often appear larger because they exclude between-subjects variance. Comparing .28 (within) to .10 (between) doesn't mean within effect is 2.8× larger.
The correction
Acknowledge that partial η² is not directly comparable across within and between effects in mixed designs. Report both but interpret cautiously: 'Within-subjects partial η² are not directly comparable to between-subjects partial η² due to different denominators.' Consider reporting generalized η² (ges in ezANOVA output) which provides comparable effect sizes across design types by including all variance. Alternatively, report effect sizes in original units (mean differences with CI) which are interpretable regardless of design: 'CBT group declined 17.8 points (95% CI [14.2, 21.4]) vs. Control 5.9 points [2.3, 9.5].' Focus interpretation on practical significance in context.
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]
Cuijpers, P., Cristea, I. A., Karyotaki, E., Reijnders, M., & Huibers, M. J. H. (2016). How effective are cognitive behavior therapies for major depression and anxiety disorders? A meta-analytic update of the evidence. World Psychiatry, 15(3), 245-258.
Meta-analysis of 269 RCTs showing CBT produces moderate-large effects for depression (d=0.6-0.8). Basis for Example 1 clinical trial design.
doi: 10.1002/wps.20346
[2]
Greenhouse, S. W., & Geisser, S. (1959). On methods in the analysis of profile data. Psychometrika, 24(2), 95-112.
Original paper on Greenhouse-Geisser correction for sphericity violation in repeated measures ANOVA. Conservative correction adjusting degrees of freedom by epsilon (ε).
doi: 10.1007/BF02289823
[3]
Huynh, H., & Feldt, L. S. (1976). Estimation of the Box correction for degrees of freedom from sample data in randomized block and split-plot designs. Journal of Educational Statistics, 1(1), 69-82.
Huynh-Feldt correction for sphericity violation. Less conservative than Greenhouse-Geisser when epsilon is large (ε>.75). Recommended when sample size is adequate.
doi: 10.3102/10769986001001069
[4]
Maxwell, S. E., Delaney, H. D., & Kelley, K. (2018). Designing Experiments and Analyzing Data: A Model Comparison Perspective (3rd ed.). Routledge.
Comprehensive textbook on factorial ANOVA designs including mixed (split-plot) designs. Chapters 12-14 cover repeated measures, mixed designs, assumptions, effect sizes, and power analysis. Essential reference for complex ANOVA designs.
[5]
Lakens, D. (2013). Calculating and reporting effect sizes to facilitate cumulative science: A practical primer for t-tests and ANOVAs. Frontiers in Psychology, 4, 863.
Practical guide to effect size calculation and interpretation for ANOVA designs. Covers eta-squared, partial eta-squared, generalized eta-squared, omega-squared with R code examples. Discusses why partial η² differs between within and between factors in mixed designs.
doi: 10.3389/fpsyg.2013.00863
A significant three-way interaction is a mathematical masterpiece. Decompose it with precision, or risk losing the truth in the complexity.
The Interpretive Rigor Directive
statminds · Three-WayMind reference · v2.2 · updated 2026-01-1715 of 15 sections