Repeated-Measures ANOVA and Sphericity Correction
Greenhouse Geisser Correction is a repeated-measures ANOVA correction used when the sphericity assumption is violated. This complete guide explains the Greenhouse Geisser epsilon, Mauchly’s test of sphericity, corrected degrees of freedom, SPSS interpretation, R workflow, Python workflow, Excel calculation logic, charts and verified results from the student-por.csv dataset.
Google AdSense top placement reserved here
Quick Answer: Greenhouse Geisser Correction Result
A Greenhouse Geisser Correction was applied to a repeated-measures ANOVA comparing student grades across G1, G2 and G3. Mauchly’s test showed that the sphericity assumption was violated, W = 0.827, χ²(2) = 122.814, p < .001. Because of this violation, the Greenhouse-Geisser corrected row should be reported instead of the ordinary sphericity-assumed row.
Final report sentence: Mauchly’s test indicated that the sphericity assumption was violated, W = 0.827, χ²(2) = 122.814, p < .001. Therefore, the Greenhouse-Geisser corrected result was used. The repeated-measures ANOVA remained significant, F(1.705, 1104.961) = 36.287, p < .001, showing that mean grades changed significantly across G1, G2 and G3.
What Is the Greenhouse Geisser Correction?
The Greenhouse Geisser Correction is used in repeated-measures ANOVA when the assumption of sphericity is not satisfied. Repeated-measures ANOVA compares the same subjects across three or more related conditions. In this example, the same students are measured on G1, G2 and G3, so the observations are not independent in the ordinary between-groups sense.
The important assumption is sphericity. Sphericity means that the variances of the paired differences between repeated measures are equal enough for the ordinary F-test to be trusted. If that assumption is violated, the standard repeated-measures ANOVA can become too liberal. In simple terms, it may report significance too easily because the degrees of freedom are too optimistic.
The Greenhouse-Geisser correction solves this problem by reducing the degrees of freedom using an epsilon value. It does not change the means. It does not change the raw grade scores. It changes the degrees of freedom used to calculate the corrected p-value.
Important statistical note: the Greenhouse Geisser Correction is not a separate test of mean differences. It is a correction applied to repeated-measures ANOVA after the sphericity assumption is violated. You still interpret the repeated-measures ANOVA, but you report the corrected degrees of freedom and corrected p-value.
If you are building a complete data-analysis workflow, you may also find these related guides useful: DAgostino Pearson Test for skewness-kurtosis normality checking, Cramer von Mises Test for distribution goodness-of-fit, Cochran C Test for testing the largest variance, and Brown Forsythe Test for robust equality-of-variance analysis.
Greenhouse Geisser Correction Formula
The core idea is simple. The ordinary repeated-measures ANOVA degrees of freedom are multiplied by the Greenhouse-Geisser epsilon value:
Corrected df = ε × original df
Here, ε is the epsilon correction factor. If epsilon is close to 1, the correction is mild. If epsilon is much smaller, the correction is stronger. With three repeated measures, the lowest possible epsilon is 0.500, also called the lower-bound correction.
| Epsilon value | Interpretation | Practical meaning |
|---|---|---|
| Near 1.000 | Sphericity is almost satisfied | The correction is very small. |
| Between 0.75 and 1.00 | Mild to moderate correction | Greenhouse-Geisser and Huynh-Feldt may give similar conclusions. |
| Much below 0.75 | Stronger sphericity violation | The corrected degrees of freedom become much smaller. |
| Lower bound | Most conservative correction | For three repeated measures, lower bound = 1 / (3 − 1) = 0.500. |
Formula applied to this example
In this dataset, the original effect degrees of freedom are 2, and the original error degrees of freedom are 1296. The Greenhouse-Geisser epsilon is 0.853. Therefore, the corrected effect df becomes about 1.705, and the corrected error df becomes about 1104.961.
Effect df: 2 × 0.853 ≈ 1.705
Error df: 1296 × 0.853 ≈ 1104.961
Greenhouse Geisser Correction Null Hypothesis and Alternative Hypothesis
The Greenhouse-Geisser row belongs to the repeated-measures ANOVA test. The hypothesis is still about whether the repeated-measure means are equal.
| Hypothesis | Meaning | Applied to this example |
|---|---|---|
| H0 | The repeated-measure means are equal. | The mean grades for G1, G2 and G3 are equal. |
| H1 | At least one repeated-measure mean is different. | At least one of G1, G2 or G3 has a different mean grade. |
Because the corrected p-value is less than .001, the null hypothesis is rejected. The data show a statistically significant change in mean grades across the three repeated grade measures.
Google AdSense middle placement reserved here
Dataset and Repeated-Measures Model Used
This worked example uses the student-por.csv student performance dataset. The repeated outcome variables are G1, G2 and G3. These represent grade measurements for the same students, so they are suitable for a repeated-measures ANOVA example.
| Item | Verified value | Explanation |
|---|---|---|
| Rows used | 649 | Total valid student observations with complete G1, G2 and G3 values. |
| Repeated measures | G1, G2, G3 | Three related grade measurements from the same students. |
| Subject identifier | case_id | Created during cleaning so each student has a unique repeated-measures ID. |
| Main model | Repeated-measures ANOVA | Used to test whether mean grade changes across G1, G2 and G3. |
External dataset source: UCI Machine Learning Repository: Student Performance dataset.
Verified Results in SPSS, R and Python
The analysis was reproduced with SPSS output and supporting R/Python-style workflows. The key result is that the ordinary repeated-measures ANOVA is significant, Mauchly’s test is also significant, and therefore the corrected Greenhouse-Geisser row should be reported.
Descriptive Statistics for G1, G2 and G3
| Repeated measure | N | Mean | Standard deviation | Minimum | Maximum | Interpretation |
|---|---|---|---|---|---|---|
| G1 | 649 | 11.3991 | 2.74527 | 0 | 19 | First grade measurement; lowest mean among the three. |
| G2 | 649 | 11.5701 | 2.91364 | 0 | 19 | Second grade measurement; slightly higher than G1. |
| G3 | 649 | 11.9060 | 3.23066 | 0 | 19 | Final grade; highest mean and largest standard deviation. |
Pairwise Difference Variances for Sphericity Check
| Difference | Mean difference | Standard deviation | Variance | Meaning |
|---|---|---|---|---|
| G2 − G1 | 0.1710 | 1.47929 | 2.188 | Small increase from first to second grade measure. |
| G3 − G1 | 0.5069 | 1.82076 | 3.315 | Largest total change from first to final grade. |
| G3 − G2 | 0.3359 | 1.27824 | 1.634 | Moderate increase from second grade measure to final grade. |
The paired-difference variances are not equal. The variance for G3 − G1 is 3.315, while the variance for G3 − G2 is only 1.634. This is the practical reason why the sphericity assumption is not satisfied.
Mauchly’s Test of Sphericity
| Statistic | Verified value | Interpretation |
|---|---|---|
| Mauchly’s W | 0.827 | The repeated-measures covariance structure departs from perfect sphericity. |
| Approx. Chi-square | 122.814 | Large chi-square value for the sphericity test. |
| df | 2 | Degrees of freedom for Mauchly’s test. |
| Sig. | < .001 | Sphericity is violated, so a correction is needed. |
Epsilon Values
| Correction | Epsilon value | Interpretation |
|---|---|---|
| Greenhouse-Geisser | 0.853 | Main correction used because sphericity is violated. |
| Huynh-Feldt | 0.855 | Very close to the Greenhouse-Geisser value in this dataset. |
| Lower-bound | 0.500 | Most conservative possible correction for three repeated measures. |
Tests of Within-Subjects Effects
| Correction row | Effect df | Error df | F | p-value | Decision |
|---|---|---|---|---|---|
| Sphericity assumed | 2.000 | 1296.000 | 36.287 | < .001 | Significant, but this row should not be the main reported row because sphericity is violated. |
| Greenhouse-Geisser | 1.705 | 1104.961 | 36.287 | < .001 | Significant and preferred for reporting. |
| Huynh-Feldt | 1.709 | 1107.581 | 36.287 | < .001 | Also significant; very close to Greenhouse-Geisser here. |
| Lower-bound | 1.000 | 648.000 | 36.287 | < .001 | Still significant under the most conservative correction. |
The F statistic is the same across correction rows because the correction changes the degrees of freedom, not the basic mean-square ratio. The important change is in the degrees of freedom and the corrected p-value. In this example, all rows remain significant, so the conclusion is stable.
Greenhouse Geisser Correction Charts and Interpretation
1. Degrees of Freedom Before and After Sphericity Correction

This chart shows the main purpose of the Greenhouse Geisser Correction. The sphericity-assumed row uses the full original degrees of freedom. The Greenhouse-Geisser row reduces both the effect df and the error df. This reduction protects the repeated-measures ANOVA from becoming too liberal when sphericity is violated.
2. Sphericity Correction Epsilon Comparison

The epsilon chart shows that the Greenhouse-Geisser value is about 0.853. This is below 1, so some correction is needed, but it is not close to the lower-bound value of 0.500. The violation is real, but the correction is not extremely severe.
3. G1, G2 and G3 Grade Distributions

The grade distribution chart shows that G3 has a slightly higher central tendency than G1 and G2. It also has a wider spread. This supports the descriptive pattern shown in the means: student grades move upward on average from G1 to G3, but individual student patterns still vary.
4. Mean G1, G2 and G3 Grades with Standard Error

The mean profile is one of the easiest charts for readers to understand. The mean rises from 11.3991 to 11.5701 and then to 11.9060. The increase is not huge, but because the same 649 students are measured repeatedly, the repeated-measures ANOVA detects a statistically significant mean change.
5. Mauchly W and Sphericity Epsilon Summary

This chart is useful because many learners confuse Mauchly’s W with epsilon. Mauchly’s W is part of the test of sphericity. Epsilon values are used after the violation is found. In this example, Mauchly’s W confirms the violation, and the Greenhouse-Geisser epsilon provides the corrected degrees of freedom.
6. Mean Grade Changes Across Repeated Measures

The total mean change from G1 to G3 is about 0.5069 grade points. The change from G1 to G2 is smaller, while the change from G2 to G3 is larger. This supports the conclusion that the final-grade measure is higher on average than the earlier grade measures.
7. Pairwise Difference Variances for Sphericity Check

This is the most important assumption chart. Sphericity requires the paired-difference variances to be roughly equal. Here they are not equal: 2.188, 3.315 and 1.634. This unequal pattern explains why Mauchly’s test is significant and why the Greenhouse-Geisser correction is needed.
8. Repeated-Measures ANOVA P-Value Comparison

The p-value comparison shows that all correction methods remain statistically significant. This makes the result robust. Even after the most conservative lower-bound correction, the repeated-measures grade effect is still significant.
9. Sample Student Grade Trajectories

The trajectory chart shows that students do not all follow the same pattern. Some improve, some decline, and some stay stable. The blue mean trajectory rises gradually, which is the pattern tested by the repeated-measures ANOVA.
How to Run Greenhouse Geisser Correction in SPSS, R, Python and Excel
Greenhouse Geisser Correction in SPSS
SPSS automatically provides Greenhouse-Geisser, Huynh-Feldt and lower-bound rows when you run a repeated-measures GLM with three or more repeated measures. The important tables are Mauchly’s Test of Sphericity and Tests of Within-Subjects Effects.
GET DATA
/TYPE=TXT
/FILE="D:\low kda score priority basis posts\first post\Greenhouse Geisser Correction\student_por_greenhouse_geisser_clean.csv"
/ENCODING='UTF8'
/DELCASE=LINE
/DELIMITERS=","
/QUALIFIER='"'
/ARRANGEMENT=DELIMITED
/FIRSTCASE=2
/VARIABLES=
case_id F8.0
school A12
sex A8
age F8.0
address A8
famsize A8
Pstatus A8
Medu F8.0
Fedu F8.0
Mjob A20
Fjob A20
reason A20
guardian A20
traveltime F8.0
studytime F8.0
failures F8.0
schoolsup A8
famsup A8
paid A8
activities A8
nursery A8
higher A8
internet A8
romantic A8
famrel F8.0
freetime F8.0
goout F8.0
Dalc F8.0
Walc F8.0
health F8.0
absences F8.0
G1 F8.0
G2 F8.0
G3 F8.0.
CACHE.
EXECUTE.
DATASET NAME GreenhouseGeisserClean WINDOW=FRONT.
VARIABLE LABELS
case_id "Case ID for repeated-measures analysis"
G1 "First period grade"
G2 "Second period grade"
G3 "Final grade"
studytime "Study time group"
failures "Number of past class failures"
absences "School absences".
FORMATS G1 G2 G3 (F8.2).
EXECUTE.
FREQUENCIES VARIABLES=G1 G2 G3
/STATISTICS=MEAN MEDIAN STDDEV MINIMUM MAXIMUM
/ORDER=ANALYSIS.
COMPUTE diff_G2_G1 = G2 - G1.
COMPUTE diff_G3_G1 = G3 - G1.
COMPUTE diff_G3_G2 = G3 - G2.
EXECUTE.
DESCRIPTIVES VARIABLES=diff_G2_G1 diff_G3_G1 diff_G3_G2
/STATISTICS=MEAN STDDEV VARIANCE MIN MAX.
GLM G1 G2 G3
/WSFACTOR=GradeTime 3 Polynomial
/MEASURE=Grade
/METHOD=SSTYPE(3)
/PLOT=PROFILE(GradeTime)
/EMMEANS=TABLES(GradeTime) COMPARE ADJ(BONFERRONI)
/PRINT=DESCRIPTIVE ETASQ OPOWER
/CRITERIA=ALPHA(.05)
/WSDESIGN=GradeTime.
OUTPUT EXPORT
/CONTENTS EXPORT=ALL
/PDF DOCUMENTFILE="D:\low kda score priority basis posts\first post\Greenhouse Geisser Correction\SPSS\Greenhouse-Geisser-Correction-SPSS-output.pdf"
EMBEDBOOKMARKS=YES
EMBEDFONTS=YES.
Greenhouse Geisser Correction in R
In R, repeated-measures ANOVA can be run with packages such as rstatix, afex or ez. The script below reshapes the data from wide format to long format and reports the corrected repeated-measures result.
install.packages(c("tidyverse", "rstatix", "afex"))
library(tidyverse)
library(rstatix)
library(afex)
base_dir <- "D:/low kda score priority basis posts/first post/Greenhouse Geisser Correction"
data_file <- file.path(base_dir, "student-por.csv")
out_dir <- file.path(base_dir, "R")
dir.create(out_dir, showWarnings = FALSE, recursive = TRUE)
student <- read.csv(data_file, sep = ";", stringsAsFactors = FALSE)
clean_data <- student %>%
mutate(case_id = row_number()) %>%
filter(!is.na(G1), !is.na(G2), !is.na(G3)) %>%
select(case_id, everything())
write.csv(clean_data, file.path(out_dir, "greenhouse_geisser_clean_data_r.csv"), row.names = FALSE)
long_data <- clean_data %>%
select(case_id, G1, G2, G3) %>%
pivot_longer(cols = c(G1, G2, G3),
names_to = "GradeTime",
values_to = "Grade") %>%
mutate(
case_id = factor(case_id),
GradeTime = factor(GradeTime, levels = c("G1", "G2", "G3"))
)
desc_table <- long_data %>%
group_by(GradeTime) %>%
summarise(
n = n(),
mean = mean(Grade),
sd = sd(Grade),
se = sd / sqrt(n),
.groups = "drop"
)
print(desc_table)
anova_result <- anova_test(
data = long_data,
dv = Grade,
wid = case_id,
within = GradeTime,
detailed = TRUE
)
print(get_anova_table(anova_result, correction = "GG"))
print(anova_result$Mauchly)
print(anova_result$`Sphericity Corrections`)
diff_table <- clean_data %>%
transmute(
diff_G2_G1 = G2 - G1,
diff_G3_G1 = G3 - G1,
diff_G3_G2 = G3 - G2
) %>%
pivot_longer(everything(), names_to = "difference", values_to = "value") %>%
group_by(difference) %>%
summarise(
mean_difference = mean(value),
sd_difference = sd(value),
variance_difference = var(value),
.groups = "drop"
)
print(diff_table)
write.csv(desc_table, file.path(out_dir, "greenhouse_geisser_descriptives_r.csv"), row.names = FALSE)
write.csv(diff_table, file.path(out_dir, "greenhouse_geisser_pairwise_difference_variances_r.csv"), row.names = FALSE)
Greenhouse Geisser Correction in Python
In Python, the workflow can be run with pandas and pingouin. The rm_anova() function provides repeated-measures ANOVA output, while sphericity() and epsilon() help verify the assumption and correction.
from pathlib import Path
import pandas as pd
import numpy as np
import pingouin as pg
import matplotlib.pyplot as plt
base_dir = Path(r"D:\low kda score priority basis posts\first post\Greenhouse Geisser Correction")
data_file = base_dir / "student-por.csv"
out_dir = base_dir / "Python"
out_dir.mkdir(parents=True, exist_ok=True)
student = pd.read_csv(data_file, sep=";")
clean = student.copy()
clean.insert(0, "case_id", np.arange(1, len(clean) + 1))
clean = clean.dropna(subset=["G1", "G2", "G3"]).copy()
clean_path = base_dir / "student_por_greenhouse_geisser_clean.csv"
clean.to_csv(clean_path, index=False)
long_df = clean[["case_id", "G1", "G2", "G3"]].melt(
id_vars="case_id",
value_vars=["G1", "G2", "G3"],
var_name="GradeTime",
value_name="Grade"
)
desc = long_df.groupby("GradeTime")["Grade"].agg(["count", "mean", "std"]).reset_index()
desc["se"] = desc["std"] / np.sqrt(desc["count"])
print(desc)
anova = pg.rm_anova(
data=long_df,
dv="Grade",
within="GradeTime",
subject="case_id",
detailed=True,
correction=True
)
print(anova)
sphericity = pg.sphericity(
data=long_df,
dv="Grade",
within="GradeTime",
subject="case_id"
)
print(sphericity)
epsilon = pg.epsilon(
data=long_df,
dv="Grade",
within="GradeTime",
subject="case_id"
)
print("Greenhouse-Geisser epsilon:", epsilon)
diffs = pd.DataFrame({
"G2 - G1": clean["G2"] - clean["G1"],
"G3 - G1": clean["G3"] - clean["G1"],
"G3 - G2": clean["G3"] - clean["G2"]
})
diff_summary = diffs.agg(["mean", "std", "var"]).T.reset_index()
diff_summary.columns = ["difference", "mean_difference", "sd_difference", "variance_difference"]
print(diff_summary)
desc.to_csv(out_dir / "greenhouse_geisser_python_descriptives.csv", index=False)
diff_summary.to_csv(out_dir / "greenhouse_geisser_python_pairwise_difference_variances.csv", index=False)
anova.to_csv(out_dir / "greenhouse_geisser_python_anova.csv", index=False)
Greenhouse Geisser Correction in Excel
Excel does not automatically provide Mauchly’s test, Greenhouse-Geisser epsilon and corrected repeated-measures ANOVA rows in the same way as SPSS, R or Python. However, Excel can still be used to explain the assumption and manually inspect paired-difference variances.
| Excel column | Content | Example formula |
|---|---|---|
| A | case_id | 1, 2, 3, … |
| B | G1 | First period grade |
| C | G2 | Second period grade |
| D | G3 | Final grade |
| E | G2 − G1 | =C2-B2 |
| F | G3 − G1 | =D2-B2 |
| G | G3 − G2 | =D2-C2 |
Variance of G2 - G1 = VAR.S(E2:E650)
Variance of G3 - G1 = VAR.S(F2:F650)
Variance of G3 - G2 = VAR.S(G2:G650)
For this dataset, Excel should give paired-difference variances close to 2.188, 3.315 and 1.634. Since these variances are not equal, Excel supports the same practical conclusion: sphericity is not satisfied, so a correction is needed for the repeated-measures ANOVA.
How to Report the Greenhouse Geisser Correction Result
A good report should mention Mauchly’s test, the correction used, the corrected degrees of freedom, the F statistic, the p-value and the direction of the mean change. Avoid writing only “Greenhouse-Geisser was significant” because that does not explain what was corrected.
APA-style report: Mauchly’s test showed that the assumption of sphericity was violated, W = 0.827, χ²(2) = 122.814, p < .001. Therefore, a Greenhouse-Geisser correction was applied. The repeated-measures ANOVA showed a significant effect of grade time, F(1.705, 1104.961) = 36.287, p < .001, partial η² ≈ .053. Mean grades increased from G1 (M = 11.40, SD = 2.75) to G2 (M = 11.57, SD = 2.91) and G3 (M = 11.91, SD = 3.23).
Plain-language report: Student grades changed significantly across G1, G2 and G3. Because the sphericity assumption was violated, the Greenhouse-Geisser corrected row was used. The corrected result was still highly significant, showing that the average grade increased across the repeated grade measurements.
When Should You Use Greenhouse Geisser Correction?
Use this correction when your repeated-measures ANOVA has three or more related levels and Mauchly’s test indicates that sphericity is violated. It is especially common in psychology, education, medical trials, sports science, repeated survey analysis and before-after-follow-up designs.
| Situation | Use it? | Reason |
|---|---|---|
| Three exam scores for the same students | Yes, if Mauchly’s test is significant | G1, G2 and G3 are related repeated measures. |
| Pre-test, post-test and follow-up score | Yes, if sphericity is violated | There are three related time points. |
| Only two paired measurements | No | Sphericity is automatically satisfied with two levels. |
| Independent groups ANOVA | No | The correction is for within-subject repeated-measures designs. |
| Mixed design with repeated factor | Sometimes | Use it for the within-subject factor if its sphericity is violated. |
Common Mistakes
1. Reporting the sphericity-assumed row after Mauchly’s test is significant
If Mauchly’s test is significant, the ordinary sphericity-assumed row should not be the main reported result. Report the Greenhouse-Geisser row or another justified correction row.
2. Thinking Greenhouse-Geisser changes the mean scores
The correction does not change G1, G2 or G3 means. It only changes the degrees of freedom and therefore the p-value calculation.
3. Using it when there are only two repeated measures
With only two related measurements, sphericity is automatically satisfied. Greenhouse-Geisser correction becomes relevant when there are three or more repeated conditions.
4. Ignoring pairwise difference variances
Mauchly’s test can look abstract. Pairwise difference variances make the assumption easier to understand. In this example, the difference variances are unequal, which explains the sphericity violation.
5. Confusing Greenhouse-Geisser and Huynh-Feldt
Both are sphericity corrections, but Greenhouse-Geisser is usually more conservative. Huynh-Feldt is often less conservative. In this dataset, both values are close, so both lead to the same conclusion.
Download SPSS Output and Verification Files
The SPSS PDF verifies the clean data import, descriptive statistics, Mauchly’s test, epsilon values, corrected within-subjects effects and repeated-measures ANOVA interpretation.
Sources and Method Notes
This post uses verified SPSS output, reproducible R/Python-style workflows and official/reference sources for the repeated-measures ANOVA and dataset context.
FAQs About Greenhouse Geisser Correction
What does Greenhouse Geisser Correction do?
It adjusts the degrees of freedom in repeated-measures ANOVA when the sphericity assumption is violated.
When should I use Greenhouse Geisser Correction?
Use it when you have three or more repeated measures and Mauchly’s test of sphericity is significant.
What does Greenhouse-Geisser epsilon mean?
Epsilon is the correction factor used to reduce the original ANOVA degrees of freedom. A value closer to 1 means a milder correction.
What was the Greenhouse-Geisser epsilon in this example?
The Greenhouse-Geisser epsilon was approximately 0.853, indicating a real but not extreme sphericity correction.
What was Mauchly’s test result in this example?
Mauchly’s test was significant, W = 0.827, χ²(2) = 122.814, p < .001, so the sphericity assumption was violated.
What result should be reported?
The Greenhouse-Geisser corrected result should be reported: F(1.705, 1104.961) = 36.287, p < .001.
Is Huynh-Feldt the same as Greenhouse-Geisser?
No. Both are sphericity corrections, but Huynh-Feldt is usually less conservative. In this example, the two epsilon values are very close.
Can this correction be done in SPSS?
Yes. SPSS automatically reports Greenhouse-Geisser, Huynh-Feldt and lower-bound rows in repeated-measures GLM output.
Can this correction be done in R?
Yes. R packages such as rstatix, afex and ez can run repeated-measures ANOVA and provide sphericity corrections.
Can this correction be done in Python?
Yes. Python packages such as pingouin can run repeated-measures ANOVA and calculate sphericity-related statistics.
Can this correction be done in Excel?
Excel can help calculate paired-difference variances, but SPSS, R or Python is better for Mauchly’s test, epsilon values and corrected ANOVA rows.
Google AdSense bottom placement reserved here


