StatsCalculators.com

Repeated Measures ANOVA

Created:January 23, 2025
Last Updated:October 7, 2025

This calculator analyzes data where the same subjects are measured multiple times under different conditions or time points. Whether you have long format data (one row per measurement) or wide format data (one row per subject with multiple measurement columns), this calculator handles both formats. Unlike regular ANOVA that compares different groups, Repeated Measures ANOVA controls for individual differences between subjects, making it more powerful for detecting treatment effects when using the same participants across conditions.

What You'll Get:

  • Complete ANOVA Table: F-statistics, p-values, and sum of squares breakdown
  • Complete Cases Analysis: Automatic handling of missing data with transparency
  • Comprehensive Assumption Testing: Normality, sphericity, and outlier detection
  • Effect Size Measures: Partial and generalized eta-squared for practical significance
  • Data Processing Insights: Clear reporting of excluded subjects and data cleaning
  • APA-Style Report: Publication-ready results formatted for academic writing

Important Note: This test requires each subject to have measurements for all conditions. Subjects with missing data will be excluded from the analysis.

Ready to analyze your repeated measures data? Load long format sample or load wide format sample to see how it works, or upload your own data to discover if there are significant changes across your conditions.

Calculator

1. Load Your Data

2. Select Data Format & Options

Leave blank to sort alphabetically by default

Related Calculators

Learn More

Repeated Measures ANOVA

Definition

Repeated Measures ANOVA analyzes the differences between three or more related measurements on the same subjects over time or under different conditions. It accounts for the correlation between repeated measurements on the same subject. It is commonly applied in within-subjects experimental designs where the same subjects are exposed to different treatments or conditions.

Formulas

F-statistic:

F=MSTreatmentMSError=SSTreatment/(k1)SSError/((k1)(n1))F = \frac{MS_{Treatment}}{MS_{Error}} = \frac{SS_{Treatment}/(k-1)}{SS_{Error}/((k-1)(n-1))}

Sum of Squares:

SSTotal=SSTreatment+SSSubjects+SSErrorSS_{Total} = SS_{Treatment} + SS_{Subjects} + SS_{Error}

Key Assumptions

Sphericity: Equal variances of differences between all pairs of groups
Normality: Differences should be approximately normally distributed
No Outliers: No significant outliers in any level of the within-subjects factor

Practical Example using rstatix

Step 1: Prepare Data

We’ll organize the scores data in a long format, which is required by rstatix. Each score will be associated with its respective student and teaching method.


library(tidyverse)
library(rstatix)

scores_long <- tibble(
  Student = rep(1:5, each = 3),
  Method = rep(c("A", "B", "C"), times = 5),
  Score = c(85, 90, 88, 78, 85, 82, 92, 95, 93, 88, 86, 89, 80, 84, 83)
)
          
Step 2: Perform Repeated Measures ANOVA

Using rstatixwe will compute repeated measures ANOVA and summarize the results. Here’s the code:


# Perform repeated measures ANOVA
res.aov <- scores_long |>
  anova_test(dv = Score, wid = Student, within = Method)

# Get ANOVA table
res.aov %>%
  get_anova_table()
          
Step 3: Interpret Results

The output provides the following key information:

  • F-statistic: F=4.925F = 4.925
  • p-value: p=0.04p = 0.04

Output:


# ANOVA Table (type III tests)

#  Effect   DFn DFd     F    p  p<.05   ges
# 1 Method   2   8   4.925 0.04    *   0.094
          
where:
  • Effect: The within-subjects factor
  • DFn: Degrees of freedom for the numerator
  • DFd: Degrees of freedom for the denominator
  • F: The F-statistic
  • p: The p-value
  • ges: The generalized eta-squared effect size
Step 4: Draw Conclusion

Since F=7.19F = 7.19 and p=0.016<α=0.05p = 0.016 \lt \alpha = 0.05 , we reject H0H_0 . There is sufficient evidence to conclude that the teaching methods differ significantly.

Effect Size

Generalized Eta-squared (η2\eta^2):

ηg2=SStreatmentSStreatment+SSerror+SSsubjects\eta^2_g = \frac{SS_{treatment}}{SS_{treatment} + SS_{error} + SS_{subjects}}

Interpretation guidelines:

  • Small effect: ηp20.01\eta^2_p \approx 0.01
  • Medium effect: ηp20.06\eta^2_p \approx 0.06
  • Large effect: ηp20.14\eta^2_p \approx 0.14

For the example above, the generalized eta-squared effect size is 0.0940.094, indicating a medium to large effect.

Code Examples

R
library(tidyverse)
library(rstatix)

# Original Data
scores <- tibble(
  Student = 1:5,
  Method_A = c(85, 78, 92, 88, 80),
  Method_B = c(90, 85, 95, 86, 84),
  Method_C = c(88, 82, 93, 89, 83)
)

# Convert to long format
scores_long <- scores |>
  pivot_longer(
    cols = starts_with("Method"),
    names_to = "Method",
    values_to = "Score"
  )

res.aov <- scores_long %>%
  anova_test(dv = Score, wid = Student, within = Method)

# Get ANOVA table
res.aov |>
  get_anova_table()
Python
import pandas as pd
from statsmodels.stats.anova import AnovaRM

# Data
data = pd.DataFrame({
    'Student': [1, 2, 3, 4, 5],
    'Method_A': [85, 78, 92, 88, 80],
    'Method_B': [90, 85, 95, 86, 84],
    'Method_C': [88, 82, 93, 89, 83]
})

# Reshape to long format
data_long = pd.melt(data, id_vars=['Student'], var_name='Method', value_name='Score')

# Repeated Measures ANOVA
anova = AnovaRM(data_long, 'Score', 'Student', within=['Method'])
res = anova.fit()
print(res)

Alternative Tests

Consider these alternatives:

  • Friedman Test: Non-parametric alternative when assumptions are violated
  • Mixed Models: When dealing with missing data or unequal time points

Verification