Atlas
statminds
GLM (Factorial Within-Subjects 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

Two-Way Repeated Measures ANOVA

The engine for Dual-Factor Within-Subject Discovery. This model audits the synergistic interaction between two repeated measures factors (e.g., Time x Condition) within the same group.

Model familyGLM (Factorial Within-Subjects Design)
Hypothesisomnibus
AliasesFactorial Within-Subjects ANOVA · Two-Factor Repeated Measures · Double-Repeated Omnibus Test
G1
Within-Subject Synergy
Identify if the effect of one temporal factor depends on the level of another.
G2
Internal Efficiency Audit
Isolate dual influences while keeping between-person variance neutralized.
G3
Interaction Forensics
Map complex response patterns across two intersecting within-subject dimensions.
Visual Overview Dashboard
1

What is it?

Two-Way Repeated Measures ANOVA assesses the impact of two independent factors on a continuous outcome, where all combinations of factors are measured on the same subjects.

2

When to use it

  • 2 Within Factors: (e.g., Time [Pre/Post] and Drug [A/B]).
  • Outcome: Continuous scale variable.
  • Single Group: Every subject goes through all 4 test cells.
3

Core Idea

We map how subjects react to both factors simultaneously. For example, does active drug reduce scores over time, while placebo does not?

Pre-TestPost-TestPlaceboActive

This design has extreme statistical power because it controls for both participant baseline and general temporal trends.

4

Hypotheses

H₀(Time): Mean scores are equal Pre vs Post.
H₀(Drug): Mean scores are equal Drug vs Placebo.
H₀(AxB): Drug effect is identical Pre vs Post.
5

How it works

Calculates distinct error terms for each test:
- Time tested against $Time \times Subjects$
- Drug tested against $Drug \times Subjects$
- Interaction tested against $Time \times Drug \times Subjects$

6

Assumptions

📈 Normality: Normality within each of the 4 conditions.
🔮 Sphericity: Equicorrelated pairwise differences.
No Carryover: Washout period between trials.
7

Important Note

Carryover effects (fatigue, learning) are the biggest threat. They must be controlled by counterbalancing or randomized scheduling of conditions.

8

Quick Example

Subj / timeActive PreActive PostPlacebo Pre
Subj 152.381.050.1
Subj 241.458.242.8
Interactive Sandbox

Two-Way RM ANOVA Live Laboratory

Adjust Time, Treatment, and Interaction values to observe how repeated measures handle multi-factor data.

Presets
Factor A Effect (Time)0
Factor B Effect (Drug)0
AxB Interaction0
Subject baseline Spread10
Residual Noise (σ)5
Repeated Profile (Grey: Subject paths Control vs Active over Time)Y-Axis: Outcome Score
20406080Active DrugPlaceboTime: Pre-TestTime: Post-Test
Two-Way RM ANOVA Table
SourceSSdfFp-value
Factor A (Time)0.010.001.0000
Factor B (Drug)0.010.001.0000
Interaction (AB)0.010.001.0000
Error (Residual)525.021--
Statistical Verdict
Time Effect (Factor A): ❌ Not Sig.
Drug Effect (Factor B): ❌ Not Sig.
Interaction (AxB): ❌ NO Interaction
No interaction. Both treatment paths run parallel over time.
The 12-Stage Precision Workflow
01Interaction Mandate
Hypotheses
We test the synergy between two within-subject worlds, asking if the trend in one factor 'warps' the trend in the other.
02Multivariate Normality
Assumptions
Ensuring that the complex web of repeated measures follows the rigorous distributional standards of parametric GLMs.
03Sphericity Grid
Diagnostics
Verifying the Sphericity assumption across the entire factorial grid—a multidimensional audit of variance consistency.
04Complex Monitoring
Examples
Analyzing FlowMotion speed vs. accuracy over 4 days of intensive practice, auditing the dual-trend convergence.
05Multivariate Pivot
Alternatives
Knowing when to abandon the Sphericity approach for the MANOVA (Profile Analysis) path if variance ratios are unstable.
06Simple Main Effects
Post-hoc
Executing targeted strikes within the interaction to explain why one factor peaked only during specific levels of the second.
07Partial η²
Effect Size
Calculating the unique impact of each repeated factor and their synergistic interaction on the outcome landscape.
08Design Efficiency
Sample Size
Exploiting the 'Within-Subject Multiplier' to maintain elite rigor with a surprisingly lean participant pool.
09Interaction First
Reporting
Narrating the interaction result as the dominant discovery, letting main effects serve as secondary context.
10Factorial RM Logic
Software
Configuring the 'Within-Subjects' grid in the environment to correctly map the intersection of both factors.
11The Interpretation Trap
Common Mistakes
Avoiding the over-simplification of interactions by carefully auditing the 'Simple Effects' before making broad claims.
12Academic Roots
References
Grounding the dual-repeated measures logic in the works of Maxwell, Delaney, and the pioneers of profile analysis.
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 A×B interaction (the effect of Factor A is constant across levels of Factor 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 (effects are not additive—the effect of one factor depends on the level of the other).

Why it matters omnibus

Two-way RM-ANOVA tests THREE null hypotheses simultaneously. CRITICAL: Sphericity must be tested separately for EACH within-subjects effect (main effect A, main effect B, and A×B interaction). If sphericity is violated for any effect, apply Greenhouse-Geisser (ε < .75) or Huynh-Feldt (ε > .75) correction to that specific effect's F-test. Interaction interpretation takes precedence—if significant, main effects may be misleading.

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; verify measurements are continuous (e.g., reaction time, brain activity, physiological measures), not discrete categories or ordinal ratings with limited levels.
Rigorous
Confirm measurement scale is truly interval/ratio with equal distances. Check measurement resolution is sufficient (not just 3-5 ordered categories). Verify scale has adequate range without floor/ceiling effects.
If violated
If ordinal with limited categories (e.g., Likert 1-5) → use Friedman test (one-way only) or ordinal regression with random effects. If binary → use generalized estimating equations (GEE) with binomial family. If count data → use Poisson or negative binomial GEE. If many ordinal levels (7+) → may proceed cautiously with RM-ANOVA.
friedmangee
How to check
Quick
Verify study design: each subject must have measurements at every Factor A × Factor B combination. For example, if A = Time (3 levels) and B = Condition (2 levels), each subject needs 3×2 = 6 measurements. Check data structure has subject ID and both factor variables.
Rigorous
Cross-tabulate subject IDs by both factors; ensure no missing cells per subject (complete factorial design per subject). Calculate intraclass correlation (ICC) to confirm substantial within-subject correlation. Verify counterbalancing if order matters.
If violated
If one factor is between-subjects and one is within-subjects → use mixed ANOVA (split-plot design). If both factors are between-subjects (independent groups) → use two-way between-subjects ANOVA. If missing combinations by design (not all subjects in all conditions) → use linear mixed model (LMM) which handles incomplete designs. If data are incomplete due to dropout → LMM with maximum likelihood handles missing data.
mixed anovalinear mixed model
How to check
Quick
Count measurements per subject—should equal (# Factor A levels) × (# Factor B levels). For 3×2 design, each subject needs 6 observations. Check for missing data patterns.
Rigorous
Create missingness map per subject; verify each subject has data at all factor combinations. Use Little's MCAR test if missing data present. Check if missingness is related to outcome or factors (MAR/MNAR).
If violated
If systematic missingness (e.g., some subjects not exposed to all conditions by design) → use linear mixed model (LMM) which handles incomplete designs via maximum likelihood. If random missingness < 5% and MCAR → listwise deletion acceptable but loses power. If > 5% missing or non-random: (1) LMM (BEST, handles missing via ML); (2) Multiple imputation (MI), then analyze each imputed dataset and pool results; (3) Consider bias if missingness related to outcome.
linear mixed model
How to check
Quick
Boxplots for each Factor A × Factor B combination; identify values > 1.5 IQR beyond quartiles. Check for extreme z-scores (|z| > 3) within each cell. Calculate difference scores and check for outliers in differences.
Rigorous
Mahalanobis distance for multivariate outliers across all timepoints/conditions. Standardized residuals from RM-ANOVA model (|r| > 3 suspect). Influence diagnostics: Cook's D > 4/n. For longitudinal data, trajectory plots can reveal anomalous patterns.
If violated
First: verify data entry errors and correct if found. If legitimate outliers: (1) Report results with and without outliers (sensitivity analysis); (2) Winsorize extreme values to 5th/95th percentiles (pre-specify); (3) Use robust RM-ANOVA with trimmed means; (4) Transform DV (log, sqrt) if outliers due to skewness; (5) Use Friedman test if outliers severe. For longitudinal data, outliers may indicate clinically meaningful events (e.g., relapse)—consider modeling explicitly.
friedman
How to check
Quick
Calculate difference scores for all pairs of conditions. Create Q-Q plots for each set of differences. Check histograms for severe skewness or heavy tails. With k conditions per factor, there are k(k-1)/2 pairwise differences per factor.
Rigorous
Shapiro-Wilk test on difference scores (p > .05 indicates normality). Check skewness (<|2|) and kurtosis (<|7|) for all difference distributions. Anderson-Darling test for small samples.
If violated
If mild violation with n ≥ 30: RM-ANOVA is robust via CLT, proceed. If notable violation: (1) Transform DV (log for right-skew, sqrt for count-like, rank-based transformation); (2) Use Friedman test (nonparametric, one-way only) or ART (aligned rank transform for factorial designs); (3) Permutation RM-ANOVA; (4) LMM with robust standard errors; (5) Bootstrap confidence intervals for pairwise differences.
friedman
How to check
Quick
Mauchly's test of sphericity (included in RM-ANOVA output) tests sphericity for EACH within-subjects effect separately (Factor A, Factor B, A×B interaction). p > .05 indicates sphericity met. Greenhouse-Geisser epsilon (ε) quantifies violation: ε near 1.0 = met, ε < .75 = moderate/severe violation.
Rigorous
Examine variance-covariance matrix for each within-subjects effect. Calculate variances of all pairwise differences. Check if variances are approximately equal (ratio of largest to smallest < 3). Epsilon values: ε < .50 = severe violation, .50-.75 = moderate, > .75 = mild.
If violated
Sphericity violation is COMMON with ≥3 levels. If Mauchly's p < .05 for an effect: (1) Apply Greenhouse-Geisser correction if ε < .75 (conservative, reduces df, increases p-value); (2) Apply Huynh-Feldt correction if ε > .75 (less conservative, better power); (3) Use multivariate approach (MANOVA, no sphericity assumption but requires n > # conditions); (4) Use LMM with unstructured covariance matrix (models actual correlation structure). NEVER ignore sphericity violation—invalidates F-test and inflates Type I error.
linear mixed model
How to check
Quick
Review study design: were conditions counterbalanced or randomized? Check if order of presentation varies across subjects. For time-based factors (e.g., pre-post), carryover is inherent and acceptable. For condition-based factors, assess whether prior condition could affect subsequent responses.
Rigorous
If order was recorded, test for order effects by including presentation order as covariate or between-subjects factor. Compare early vs late measurements within subjects to detect practice/fatigue effects. Check if results differ between counterbalancing orders.
If violated
If carryover suspected but not counterbalanced: (1) Include order/sequence as covariate in LMM; (2) Add washout period between conditions (if prospective design); (3) Analyze only first-presented condition per subject (loses power); (4) Model carryover explicitly with lag terms. If systematic practice/fatigue: (5) Include time/trial number as covariate. For factorial designs with time as one factor, carryover is inherent to design (e.g., dose × time in drug studies).
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 effect (Factor A, Factor B, interaction)
  2. Greenhouse-Geisser and Huynh-Feldt epsilon values to quantify sphericity violations
  3. Q-Q plots of difference scores for normality assessment
  4. Boxplots for each Factor A × Factor B cell to identify outliers
  5. Interaction plot (profile plot) to visualize A×B interaction pattern
Recommended checks
  1. Shapiro-Wilk test on difference scores (if n < 50)
  2. Variance-covariance matrix inspection for each within-subjects effect
  3. Residual vs fitted plot from model
  4. Within-subject trajectory plots (spaghetti plots) to visualize individual patterns
  5. Descriptive statistics (M, SD, n) for each cell
  6. Intraclass correlation (ICC) to quantify within-subject correlation
  7. Simple effects analysis if interaction significant
  8. Effect size estimates with confidence intervals
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

Reaction Time Across Practice Sessions and Task Difficulty (3×2 Design)

Research question: How do practice and task difficulty interact to affect reaction time? Design: 3 Practice Sessions (Session 1, 2, 3) × 2 Task Difficulty levels (Easy, Hard), fully within-subjects (n=35 participants, 6 measurements per participant, total N=210 observations). Outcome: Reaction time in milliseconds (continuous). Hypothesis: Practice reduces RT more for hard tasks (interaction)—skill acquisition more beneficial when task is challenging.

Design3×2 within-subjects factorial
Total n210
Outcome ScaleReaction time (ms, continuous)
# Two-way Repeated Measures ANOVA: Practice × Difficulty on RT
# 3×2 within-subjects design with sphericity corrections

library(tidyverse)
library(ez)          # For ezANOVA
library(rstatix)     # For anova_test
library(emmeans)     # For simple effects
library(effectsize)  # For effect sizes
library(ggpubr)      # For plots

set.seed(2025)

# Simulate realistic RT data with practice × difficulty interaction
# Hard task benefits more from practice (steeper slope)
subjects <- 1:35
data_list <- list()

for (subj in subjects) {
  # Subject-specific baseline RT (individual differences)
  baseline <- rnorm(1, 500, 50)
  
  data_list[[subj]] <- data.frame(
    subject = subj,
    session = rep(1:3, each=2),
    difficulty = rep(c("Easy", "Hard"), 3),
    RT = c(
      # Session 1
      baseline - 50 + rnorm(1, 0, 20),  # Easy S1
      baseline + 100 + rnorm(1, 0, 30), # Hard S1
      # Session 2: practice improves both, more for hard
      baseline - 70 + rnorm(1, 0, 20),  # Easy S2 (small gain)
      baseline + 60 + rnorm(1, 0, 30),  # Hard S2 (large gain)
      # Session 3: further practice
      baseline - 80 + rnorm(1, 0, 20),  # Easy S3 (ceiling)
      baseline + 30 + rnorm(1, 0, 30)   # Hard S3 (continued gain)
    )
  )
}

data <- bind_rows(data_list) %>%
  mutate(
    subject = factor(subject),
    session = factor(session, levels=1:3, labels=c("Session1", "Session2", "Session3")),
    difficulty = factor(difficulty, levels=c("Easy", "Hard"))
  )

# === STEP 1: Descriptive Statistics by Cell ===
cat("=== Cell Means(ms) ===\n")
data %>%
  group_by(session, difficulty) %>%
  summarise(n=n(), M=mean(RT), SD=sd(RT), .groups='drop') %>%
  pivot_wider(names_from=difficulty, values_from=c(M, SD)) %>%
  print()

# === STEP 2: Visualize Data ===

# Profile plot (interaction plot)
interaction_summary <- data %>%
  group_by(session, difficulty) %>%
  summarise(M=mean(RT), SE=sd(RT)/sqrt(n()), .groups='drop')

ggplot(interaction_summary, aes(x=session, y=M, color=difficulty, group=difficulty)) +
  geom_line(size=1.5) +
  geom_point(size=4) +
  geom_errorbar(aes(ymin=M-SE, ymax=M+SE), width=0.15) +
  labs(title="Practice × Difficulty Interaction on Reaction Time",
       subtitle="Hard task benefits more from practice(steeper slope = interaction)",
       x="Practice Session", y="Mean RT(ms) ± SE",
       color="Task Difficulty") +
  scale_color_manual(values=c("Easy"="#00BA38", "Hard"="#F8766D")) +
  theme_classic(base_size=14)

# Individual trajectories (spaghetti plot)
ggplot(data, aes(x=session, y=RT, group=interaction(subject, difficulty), color=difficulty)) +
  geom_line(alpha=0.3) +
  stat_summary(aes(group=difficulty), fun=mean, geom="line", size=2) +
  labs(title="Individual RT Trajectories Across Practice",
       x="Session", y="Reaction Time(ms)") +
  facet_wrap(~difficulty) +
  theme_minimal()

# === STEP 3: Check Assumptions ===

# Outliers (boxplots by cell)
ggboxplot(data, x="session", y="RT", color="difficulty",
          palette="jco", add="jitter",
          title="RT Distribution by Cell(Check Outliers)",
          xlab="Session", ylab="RT(ms)")

# Normality of difference scores (key assumption)
# Calculate differences for Session factor
data_wide <- data %>%
  pivot_wider(id_cols=c(subject, difficulty), 
              names_from=session, 
              values_from=RT)

for (diff_level in c("Easy", "Hard")) {
  cat("\n=== Normality Tests: Session differences at", diff_level, "difficulty ===\n")
  diff_data <- data_wide %>% filter(difficulty == diff_level)
  
  # S2-S1 difference
  diff1 <- diff_data$Session2 - diff_data$Session1
  print(shapiro.test(diff1))
  
  # S3-S1 difference
  diff2 <- diff_data$Session3 - diff_data$Session1
  print(shapiro.test(diff2))
}

# === STEP 4: Two-way RM-ANOVA ===
cat("\n=== Two-way Repeated Measures ANOVA ===\n")

# Using ez::ezANOVA (comprehensive output)
rm_anova <- ezANOVA(
  data = data,
  dv = RT,
  wid = subject,
  within = .(session, difficulty),
  detailed = TRUE,
  type = 3
)

print(rm_anova$ANOVA)

# === STEP 5: Sphericity Tests ===
cat("\n=== Mauchly's Test of Sphericity ===\n")
print(rm_anova$`Mauchly's Test for Sphericity`)

cat("\n=== Sphericity Corrections ===\n")
print(rm_anova$`Sphericity Corrections`)

cat("
=== Interpretation Guide ===
For EACH within-subjects effect(session, difficulty, session:difficulty):
- If Mauchly's p > .05: sphericity met, use uncorrected F-test
- If Mauchly's p < .05 AND GG epsilon < .75: use Greenhouse-Geisser correction
- If Mauchly's p < .05 AND GG epsilon > .75: use Huynh-Feldt correction

Note: Difficulty has only 2 levels, so sphericity is automatically met(no correction needed).
Session has 3 levels, so sphericity can be violated(check epsilon).
Interaction has 3×2=6 cells with(3-1)×(2-1)=2 df, so sphericity can be violated.
")

# === STEP 6: Effect Sizes ===
cat("\n=== Effect Sizes(Generalized η²) ===\n")
print(rm_anova$ANOVA[, c("Effect", "ges")])

# Using rstatix for partial eta squared
rm_anova2 <- anova_test(
  data = data,
  dv = RT,
  wid = subject,
  within = c(session, difficulty)
)

cat("\n=== Partial η² ===\n")
print(get_anova_table(rm_anova2))

# === STEP 7: Simple Effects Analysis (if interaction significant) ===
if (rm_anova$ANOVA$p[3] < 0.05) {  # Check interaction p-value
  cat("\n=== Interaction Significant: Simple Effects Analysis ===\n")
  
  # Fit model for emmeans
  model <- lm(RT ~ session * difficulty, data=data)
  
  # Simple effects: Session at each Difficulty level
  emm_session <- emmeans(model, ~ session | difficulty)
  cat("\nEffect of Practice Session within each Difficulty level:\n")
  pairs_session <- pairs(emm_session, adjust="bonferroni")
  print(summary(pairs_session))
  
  # Test linear trend for practice effect
  cat("\n=== Linear Trend: Practice Effect ===\n")
  contrast_linear <- contrast(
    emm_session,
    list(linear = c(-1, 0, 1)),
    by = "difficulty"
  )
  print(summary(contrast_linear))
  
  # Effect sizes for simple effects
  cat("\n=== Effect Sizes: Practice Effect by Difficulty ===\n")
  
  # Easy: Session 3 vs Session 1
  easy_s1 <- data %>% filter(difficulty=="Easy", session=="Session1") %>% pull(RT)
  easy_s3 <- data %>% filter(difficulty=="Easy", session=="Session3") %>% pull(RT)
  d_easy <- effsize::cohen.d(easy_s1, easy_s3, paired=TRUE)$estimate
  cat(sprintf("Easy task - Practice effect(S1 vs S3): d = %.2f\n", d_easy))
  
  # Hard: Session 3 vs Session 1
  hard_s1 <- data %>% filter(difficulty=="Hard", session=="Session1") %>% pull(RT)
  hard_s3 <- data %>% filter(difficulty=="Hard", session=="Session3") %>% pull(RT)
  d_hard <- effsize::cohen.d(hard_s1, hard_s3, paired=TRUE)$estimate
  cat(sprintf("Hard task - Practice effect(S1 vs S3): d = %.2f\n", d_hard))
  
  cat(sprintf("\n→ Practice effect %.2f times larger for hard task(d=%.2f) vs easy(d=%.2f)\n",
              d_hard/d_easy, d_hard, d_easy))
}

# === STEP 8: Visualization (Publication Quality) ===
# Bar plot with error bars
data_summary <- data %>%
  group_by(session, difficulty) %>%
  summarise(M=mean(RT), SE=sd(RT)/sqrt(n()), .groups='drop')

ggplot(data_summary, aes(x=session, y=M, fill=difficulty)) +
  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="Skill Acquisition: Practice × Difficulty Interaction",
       x="Practice Session", y="Mean Reaction Time(ms) ± SE",
       fill="Task Difficulty") +
  scale_fill_brewer(palette="Set1") +
  theme_classic(base_size=14)

# === APA-Style Report ===
cat("
=== APA-STYLE RESULTS ===
A 3×2 within-subjects ANOVA examined the effects of practice session(1, 2, 3) 
and task difficulty(Easy, Hard) on reaction time(N = 35 participants, 6 
measurements each). Mauchly's test indicated sphericity was met for the session 
main effect(p = .18) but violated for the interaction(p = .042, ε = .89). 
Huynh-Feldt corrections were applied to the interaction term(ε > .75).

Results revealed significant main effects of session, F(2, 68) = 124.56, 
p < .001, partial η² = .79 (very large), and difficulty, F(1, 34) = 89.23, 
p < .001, partial η² = .72 (very large). CRITICALLY, there was a significant 
Session × Difficulty interaction, F(1.78, 60.52) = 12.45, p < .001 (Huynh-Feldt 
corrected), partial η² = .27 (large effect).

Simple effects analysis revealed that practice reduced RT for both difficulty 
levels(both p < .001), but the effect was significantly larger for hard tasks. 
From Session 1 to Session 3:
- Easy task: 450ms → 420ms (30ms reduction, d = 0.85)
- Hard task: 600ms → 530ms (70ms reduction, d = 1.82)

The practice effect was 2.1 times larger for hard tasks, supporting skill 
acquisition theory: practice benefits are greatest when tasks are challenging 
and require substantial learning. Findings have implications for training 
protocols—allocate more practice time to difficult skills.
")
Interpretation Blueprint

Main effects: Session F(2, 68) = 124.56, p < .001, partial η² = .79; Difficulty F(1, 34) = 89.23, p < .001, partial η² = .72. Interaction: F(1.78, 60.52) = 12.45, p < .001 (Huynh-Feldt corrected due to sphericity violation), partial η² = .27 (large). CRITICAL: Interaction shows practice effect is difficulty-dependent. Hard tasks show 70ms improvement (d=1.82) vs easy tasks 30ms (d=0.85). Non-parallel slopes indicate differential learning rates—challenging tasks benefit more from practice, consistent with skill acquisition theory (Heathcote et al., 2000). Practical implication: training protocols should allocate proportionally more practice time to difficult skills.

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 Dual-RM ANOVA. Optimal for high-fidelity physiological or performance markers measured over two intersecting timeframes.
Peak Signal
Interval
Ideal for Primary Scales. Ensure no significant ceiling/floor effects disrupt the interaction between the two within-subject factors.
Standard Precision
Ordinal
Pivot to Scheirer-Ray-Hare Test (Factorial Non-Parametric) if residuals are severely non-normal or data is ranked.
Rank Compression
Nominal
Abandon ANOVA. Use Multi-Way Log-Linear Analysis to model the frequencies of categorical status flips across time.
Information Suicide
Temporal Trajectory Audit Dual-Factor Within-Subjects
Repeated x Repeated
Two temporal factors.
Stay with Two-Way RM ANOVA. The elite standard for auditing the interaction between two internal rhythms.
Missing Sequences
Unbalanced time data.
Pivot to Linear Mixed Models (LMM) to preserve the system's power despite participant drop-out.
Continuous Dynamic
Streaming time data.
Pivot to VAR (Vector Autoregression) to model the dynamic feedback between the two repeated processes.
Adaptive Technical Safeguards · adaptive safeguards
multi sphericity failure
  • Greenhouse-Geisser Shield — Mandatory DF adjustment for both temporal factors and their interaction.
  • MANOVA Path — Treat the 4+ cells as a multivariate vector to bypass the sphericity mandate entirely.
Non-normal residuals
  • Bootstrap Interaction Strike — Generate robust confidence intervals for the dual-temporal synergy term.
  • Log-Transformation — Neutralize right-skewed temporal recovery units.
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

No specific guidelines provided.

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 after removing variance from other factors. Most commonly reported for RM-ANOVA. Small: .01, Medium: .06, Large: .14 (Cohen, 1988)

Comparable across different designs (within vs between vs mixed). Small: .02, Medium: .13, Large: .26 (Bakeman, 2005). Recommended when comparing effect sizes across studies with different designs.

For pairwise comparisons (simple effects). Calculated on difference scores. Small: 0.2, Medium: 0.5, Large: 0.8. Reports magnitude of specific contrasts.

Coefficient of concordance (0-1) for Friedman test (nonparametric alternative). Measures agreement/consistency across repeated measures.

Recommended Metric: partial_eta_squared for omnibus effects (main effects and interaction); Cohen's d (paired) for simple effects and pairwise comparisons
Small
0.2
Medium
0.5
Large
0.8
0.50
partial_eta_squared for omnibus effects (main effects and interaction); Cohen's d (paired) for simple effects and pairwise comparisons
Recommended Measure
4
Available Metrics
ReportUse partial_eta_squared for omnibus effects (main effects and interaction); Cohen's d (paired) for simple effects and pairwise comparisons 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 'Dual-Temporal' Minimum: A minimum of 15 participants is required for a 2x2 within-subjects design. Power is high due to self-matching, but model stability collapses if measurement error is high.

Effect SizeParametersRequired n
Small Effectf=.10 (Small)n ≈ 110 total
Medium Effectf=.25 (Medium)n ≈ 24 total
Large Effectf=.40 (Large)n ≈ 12 total
Key considerations

Multi-Sphericity Strike: You must audit sphericity for both factors AND their interaction. If epsilon < 0.75, increase your sample size by 20% to compensate for the Greenhouse-Geisser power deflation.

G*Power StrategyBenchmark: F-tests → ANOVA: Repeated measures, within factors (2x2). Parameters: 4 total cells, α = .05, Power = .80, Correlation = 0.5. The 'Synergy Power': Detecting within-subject interactions is 2x more efficient than between-subject interactions.
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 3×2 within-subjects ANOVA examined reaction time across three practice sessions and two task difficulty levels (N = 35 participants, 6 measurements each). Mauchly's test indicated that the assumption of sphericity was met for the session main effect (χ²(2) = 3.45, p = .18) and was automatically met for difficulty (2 levels). The session × difficulty interaction sphericity test was not significant (χ²(2) = 4.12, p = .13). Results revealed significant main effects of session, F(2, 68) = 124.56, p < .001, partial η² = .79 (very large), and difficulty, F(1, 34) = 89.23, p < .001, partial η² = .72 (very large). Critically, there was a significant Session × Difficulty interaction, F(2, 68) = 12.45, p < .001, partial η² = .27 (large effect). Simple effects analysis revealed that while practice reduced RT for both difficulty levels (both p < .001), the practice effect was significantly larger for hard tasks (70ms reduction, d = 1.82) than easy tasks (30ms reduction, d = 0.85). These findings demonstrate that skill acquisition benefits are greatest for challenging tasks, with practice producing 2.1 times larger RT improvements for hard compared to easy tasks. Results support adaptive training protocols that allocate more practice time to difficult skills.
Reusable template

A a × b within-subjects ANOVA examined brief description of research question, e.g., 'reaction time across practice sessions and task difficulty'. Sample: 'N = X participants completed all [a×b measurements.'] Sphericity: For EACH within-subjects effect, report Mauchly's test: 'Mauchly's test indicated that the assumption of sphericity was [met/violated for Factor A (χ²(df) = X.XX, p = .XX, ε = .XX) repeat for Factor B and interaction.' If violated: 'Therefore, Greenhouse-Geisser/Huynh-Feldt corrected results are reported for effect name.'] Results revealed significant/non-significant main effects of Factor A, F(df1, df2) = X.XX, p = .XXX, partial η² = .XX interpret, and Factor B, F(df1, df2) = X.XX, p = .XXX, partial η² = .XX. CRITICAL: Report interaction The A × B interaction was significant/non-significant, F(df1, df2) = X.XX, p = .XXX use corrected df if sphericity violated, partial η² = .XX. If interaction significant: 'Simple effects analysis revealed...' describe pattern, report simple effects F-tests or pairwise comparisons with corrections. Include cell means, SDs for key comparisons. Conclude with interpretation in research context.

Essential statistics to report
  • F-statistics with df for BOTH main effects AND interaction (use corrected df if sphericity violated)
  • p-values for all three F-tests (use corrected p-values if sphericity violated)
  • Effect sizes (partial η² or generalized η²) for all effects
  • Mauchly's test results for EACH within-subjects effect (W, df, p, ε)
  • Which correction used (GG or HF) for each violated effect
  • Cell means, SDs, and n for each Factor A × Factor B combination
  • Simple effects results if interaction significant (F-tests or pairwise t-tests with corrections)
  • Effect sizes for simple effects (Cohen's d for pairwise comparisons)
  • 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 Repeated Measures ANOVA Summary for Multimodal Recovery
SourceSSdfMSFpηp²
Time (Within)85.21.847.312.42< .001.17
Condition (Within)12.4112.43.15.082.05
Time × Condition44.11.824.56.42.004.10
Error342.1104.43.27
Note. Results based on Time × Condition factorial grid. N = 60.
Time × Condition (p=.004)This significant synergy proves that the recovery rate is condition-specific. Reporting main effects alone would be scientifically misleading.
ηp² (.10)Identifies a moderate interaction effect. 10% of the within-subject variance is explained by the condition-time synergy.
Header glossary

The Synergy Audit. Determines if the trajectory of recovery depends on the treatment condition.

Penalty adjustment for Sphericity. Higher violations result in lower (fractional) degrees of freedom.

The Multiplier. Measures the signal strength of each interaction relative to internal subject noise.

Partial Eta-Squared. The percentage of the subject's internal variance captured by the interaction.

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 Multi-Factor RM-ANOVA
model <- aov_ez(id = 'subject_id', dv = 'score', data = df, within = c('time', 'condition'))

# 2. Map Trajectory Interactions
emmip(model, condition ~ time)
Library stack
R
afexemmeansggplot2
Python
pingouinseaborn
Elite Forensic Strike

Audit the 3D variance-covariance matrix to ensure internal consistency across conditions and time.

# Execute Full Assumption Battery
performance::check_model(model)

# Standardized Effect Size Forensics
report::report_effectsize(model)
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
Two-way RM-ANOVA has THREE within-subjects effects that can each violate sphericity: Factor A main effect, Factor B main effect, and A×B interaction. Each effect has its OWN variance-covariance structure that must be tested. You cannot assume that if sphericity is met for one effect, it's met for all. Sphericity can be violated for the interaction but not main effects, or vice versa.
The correction
Always examine Mauchly's test for ALL within-subjects effects. If Factor A has > 2 levels, test sphericity for A. If Factor B has > 2 levels, test for B. If A×B has > 1 df, test for interaction. Apply corrections (GG or HF) SEPARATELY to each violated effect. Report corrected df and p-values for violated effects, uncorrected for effects meeting sphericity.
Why it's wrong
Between-subjects ANOVA treats all observations as independent, severely violating the independence assumption when same subjects are measured multiple times. This inflates Type I error rates, uses wrong error term (between-subject instead of within-subject variability), and loses the statistical power advantage of within-subjects designs (smaller error terms due to removing subject variability).
The correction
Always use repeated measures ANOVA for within-subjects designs. Specify Error(subject/(factorA*factorB)) in R aov() or use ez::ezANOVA with wid=subject and within=.(factorA, factorB). Software must account for within-subject correlation. Check that df matches repeated measures structure (e.g., dfB for subjects).
Why it's wrong
When interaction is present, main effects are AVERAGES that 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 near zero, completely hiding the true conditional effects. Main effects ignore that effects are not uniform across levels of the other factor.
The correction
If interaction p < .05: (1) Always conduct simple effects analysis; (2) Test effect of Factor A at each level of Factor B (or vice versa); (3) Report simple effects F-tests or pairwise comparisons; (4) Interpret results in terms of the interaction pattern, not main effects; (5) Use interaction plots to visualize conditional effects. Main effects can be reported for completeness but must be qualified by interaction.
Why it's wrong
Sphericity violation means variances of pairwise differences are unequal, invalidating the F-test. Using uncorrected F-tests inflates Type I error (liberal test, too many false positives). The uncorrected test assumes compound symmetry, which is violated. This is especially problematic with ≥3 levels per factor, where sphericity violations are common.
The correction
Always check Mauchly's test. If p < .05 for any effect: (1) Apply Greenhouse-Geisser correction if ε < .75 (conservative, safer with severe violations); (2) Apply Huynh-Feldt if ε > .75 (less conservative, better power); (3) Report corrected df and p-values explicitly; (4) State which correction was used; (5) NEVER report uncorrected results when sphericity is violated.
Why it's wrong
Listwise deletion removes any subject with ≥1 missing cell, drastically reducing sample size and power. With 12 cells (e.g., 4×3 design), even 10% random missingness can eliminate 70%+ of subjects. If missingness is not MCAR, listwise deletion introduces bias. Even with MCAR, it's inefficient—wastes valid data from incomplete cases.
The correction
Use linear mixed models (LMM) which handle missing data via maximum likelihood—no case deletion needed. LMM is unbiased under MAR and more powerful. In R: lme4::lmer; in Python: statsmodels MixedLM. Alternatively, use multiple imputation (MI). Only use listwise deletion if missingness < 5% and demonstrably MCAR.
Why it's wrong
Carryover occurs when earlier conditions affect responses to later conditions (e.g., practice, fatigue, priming, drug washout). If not controlled or modeled, carryover can confound results—apparent factor effects may actually reflect order effects. This is especially critical when conditions represent treatments or manipulations, not natural time progression.
The correction
If conditions were counterbalanced: (1) Include counterbalancing order as between-subjects factor or covariate in analysis; (2) Test for order × condition interaction; (3) If order effects found, interpret results cautiously or analyze only first-presented condition. If conditions represent time (e.g., pre-post), carryover is inherent and acceptable. For crossover trials, ensure adequate washout periods.
Why it's wrong
Interaction F-tests tell you IF there's an interaction but not WHAT KIND. Without plots, you can't distinguish crossover interactions (lines cross, effects reverse), ordinal interactions (lines diverge but don't cross), or spreading interactions (one factor's effect increases across levels of other factor). Numeric tables alone are insufficient for interpretation.
The correction
ALWAYS create interaction plots: plot Factor B on x-axis, DV on y-axis, separate lines for Factor A levels. Non-parallel lines indicate interaction. Also useful: heatmaps, faceted plots, individual trajectory plots (spaghetti plots). Visualization is essential for interpretation and communication. Include error bars (SE or CI) to assess uncertainty.
Why it's wrong
Software requires explicit specification of which factors are within-subjects (repeated measures on same participants) vs between-subjects (independent groups). Misspecification uses wrong error terms, incorrect df, and invalid F-tests. For example, treating a within-subjects factor as between-subjects inflates Type I error and ignores within-subject correlation.
The correction
Carefully verify study design before analysis: (1) Within-subjects: same participants measured at all levels of both factors; (2) Between-subjects: different participants in each cell; (3) Mixed: one factor within, one between. In R ez::ezANOVA: specify within-subjects factors in within=.() and between-subjects in between=.(). Check that software output shows correct df structure for design.
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]
Bakeman, R. (2005). Recommended effect size statistics for repeated measures designs. Behavior Research Methods, 37(3), 379-384.
Generalized eta squared (ηG²) is recommended for RM-ANOVA as it's comparable across different designs (within vs between vs mixed). Provides benchmarks for effect size interpretation.
doi: 10.3758/BF03192707
[2]
Greenhouse, S. W., & Geisser, S. (1959). On methods in the analysis of profile data. Psychometrika, 24(2), 95-112.
Greenhouse-Geisser correction for sphericity violation. Conservative correction, recommended when ε < .75. Widely used and implemented in all major statistical software.
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, better power when ε > .75. Preferred when sphericity violation is mild.
doi: 10.3102/10769986001001069
[4]
Mauchly, J. W. (1940). Significance test for sphericity of a normal n-variate distribution. Annals of Mathematical Statistics, 11(2), 204-209.
Original paper on Mauchly's test of sphericity, the standard diagnostic for sphericity assumption in repeated measures ANOVA.
doi: 10.1214/aoms/1177731915
[5]
Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences (2nd ed.). Lawrence Erlbaum Associates.
Classic reference for effect size interpretation guidelines and power analysis for factorial ANOVA designs, including repeated measures.
[6]
Heathcote, A., Brown, S., & Mewhort, D. J. K. (2000). The power law repealed: The case for an exponential law of practice. Psychonomic Bulletin & Review, 7(2), 185-207.
Practice effects on reaction time show larger benefits for difficult tasks. Basis for Example 1.
doi: 10.3758/BF03212979
[7]
Price, C. J. (2012). A review and synthesis of the first 20 years of PET and fMRI studies of heard speech, spoken language and reading. NeuroImage, 62(2), 816-847.
Left hemisphere language dominance with temporal > frontal activation. Basis for Example 2.
doi: 10.1016/j.neuroimage.2012.04.062
[8]
Law, M. R., Morris, J. K., & Wald, N. J. (2009). Use of blood pressure lowering drugs in the prevention of cardiovascular disease: Meta-analysis of 147 randomised trials in the context of expectations from prospective epidemiological studies. BMJ, 338, b1665.
Dose-response relationships for antihypertensive medications. Meta-analysis of 147 RCTs. Basis for Example 3.
doi: 10.1136/bmj.b1665
In a double-repeated world, trends rarely travel alone. The most significant discovery is usually the moment they collide.
The Interpretive Rigor Directive
statminds · Two-WayMind reference · v2.2 · updated 2026-01-1715 of 15 sections