UK-based online statistics and data analysis support for USA, UK, and international clients. No exams, no impersonation, no fabricated data.
ANOVA Family

Two Way ANCOVA: Formula, Interpretation, SPSS, Python, R and Excel Guide

Adjusted Means, G1 Covariate, School × Sex Interaction and Partial Eta Squared Two Way ANCOVA: Formula, Interpretation, SPSS, Python, R and Excel Guide Two Way ANCOVA...

Statistics guide Ethical learning support SPSS/R/Python/Excel friendly
Two Way ANCOVA: Formula, Interpretation, SPSS, Python, R and Excel Guide

Adjusted Means, G1 Covariate, School × Sex Interaction and Partial Eta Squared

Two Way ANCOVA: Formula, Interpretation, SPSS, Python, R and Excel Guide

Two Way ANCOVA tests whether a continuous outcome differs across two categorical factors after adjusting for one or more covariates. In this worked Salar Cafe example, the outcome is G3 final grade, the two factors are school and sex, and the covariate is G1. After controlling for G1, the ANCOVA shows significant school and sex effects, while the school × sex interaction is not significant.

Advertisement
Google AdSense top placement reserved here

Quick Answer: Two Way ANCOVA Result

The worked Two Way ANCOVA compares adjusted G3 means for school and sex after controlling for G1. The covariate is extremely important in this model because earlier grade performance strongly predicts final grade.

The Python summary table reports that G1 is significant, F = 1200, p = 2.77e-149, partial η² = 0.6508. After this covariate adjustment, school remains significant, F = 5.136, p = 0.02377, partial η² = 0.007912. Sex is also significant, F = 4.93, p = 0.02674, partial η² = 0.007598. The school × sex interaction is not significant, F = 0.0006807, p = 0.9792.

The SPSS output confirms the same decision pattern. The Type III ANCOVA table reports G1 p < .001, school p = .027, sex p = .036, and school × sex p = .979. The corrected model explains a large amount of variation, with R² = .687 and adjusted R² = .685.

MethodTwo Way ANCOVA
OutcomeG3
Factorsschool, sex
CovariateG1
G1 covariatep < .001
schoolp = .02377
sexp = .02674
school × sexp = .9792
Largest effectG1
G1 ηp²0.651
school ηp²0.008
sex ηp²0.008

Final interpretation: After controlling for G1, adjusted G3 differs by school and sex. Female students have higher adjusted means than male students in both schools, and GP remains higher than MS after adjustment. The school × sex interaction is not significant, so the difference between female and male students is not meaningfully different across schools.

Important reporting point: Two Way ANCOVA is not the same as Two Way ANOVA. ANCOVA compares adjusted means after controlling for a covariate. In this example, raw school and sex means are reduced after controlling for G1, showing why covariate adjustment matters.

Table of Contents

  1. What Is Two Way ANCOVA?
  2. Two Way ANCOVA Formula
  3. Two Way ANCOVA Hypotheses
  4. Dataset and Variables Used
  5. Two Way ANCOVA Assumptions
  6. SPSS Output Interpretation
  7. Python Chart-by-Chart Interpretation
  8. R Chart-by-Chart Validation
  9. SPSS, R, Python and Excel Workflows
  10. Code Blocks for Two Way ANCOVA
  11. APA Reporting Wording
  12. Common Mistakes
  13. When to Use Two Way ANCOVA
  14. Downloads and Resources
  15. Related Guides
  16. FAQs

What Is Two Way ANCOVA?

Two Way ANCOVA is an analysis of covariance model with one numeric dependent variable, two categorical independent variables and at least one numeric covariate. It combines the group-comparison logic of Factorial ANOVA with the covariate-adjustment logic of ANCOVA.

In a standard One Way ANOVA, group means are compared directly. In Two Way ANCOVA, group means are compared after adjusting for a covariate. In this example, G1 is the covariate because earlier grade performance is strongly related to G3 final grade. The model asks whether school and sex still matter after G1 is controlled.

The result shows that G1 explains the largest share of G3 variation. However, school and sex still show statistically significant adjusted effects. The interaction between school and sex is almost zero and not significant, which means the school difference does not meaningfully depend on sex and the sex difference does not meaningfully depend on school.

Simple definition: Two Way ANCOVA compares adjusted group means for two factors after controlling for a covariate. Here, it compares adjusted G3 means for school and sex after controlling for G1.

This guide connects naturally with One Way ANCOVA, ANOVA Assumptions, ANOVA Effect Size, Eta Squared, Omega Squared, F Distribution, ANOVA in SPSS, ANOVA in R and ANOVA in Python.

Two Way ANCOVA Formula

A two-factor ANCOVA model includes the covariate, the two main effects, the two-way interaction and the residual error term. The model can be written as:

Yijk = μ + Ai + Bj + ABij + β(Xijk − X̄) + eijk

In this formula, Y is the dependent variable, A is the first factor, B is the second factor, AB is the interaction, X is the covariate, and β is the covariate slope. In this example, Y is G3, A is school, B is sex and X is G1.

F Statistic Formula

F = MSeffect / MSerror

Each ANCOVA effect has its own F statistic. The covariate has an F test, each main effect has an F test, and the interaction has an F test. A significant F test means that the effect explains variation in G3 after the other model terms are considered.

Partial Eta Squared Formula

partial η² = SSeffect / (SSeffect + SSerror)

Partial eta squared shows the practical size of each adjusted effect. In this model, the covariate G1 has a very large effect, with partial eta squared around 0.651. School and sex are statistically significant but much smaller, with partial eta squared values around 0.008. The school × sex interaction is essentially zero.

EffectdfFpPartial η²DecisionInterpretation
G1112002.77e-1490.6508Reject H0Very strong covariate effect.
school15.1360.023770.007912Reject H0Adjusted G3 differs by school.
sex14.930.026740.007598Reject H0Adjusted G3 differs by sex.
school × sex10.00068070.97920.000001Fail to reject H0No adjusted interaction evidence.

Two Way ANCOVA Hypotheses

Two Way ANCOVA has separate hypotheses for the covariate, each main effect and the interaction. The interaction should be interpreted before over-explaining the main effects.

EffectNull HypothesisAlternative HypothesisDecision in This Output
G1 covariateG1 does not predict G3 after school and sex are included.G1 predicts G3 after school and sex are included.Reject H0.
schoolAdjusted mean G3 is equal for GP and MS.Adjusted mean G3 differs by school.Reject H0.
sexAdjusted mean G3 is equal for female and male groups.Adjusted mean G3 differs by sex.Reject H0.
school × sexThe adjusted school difference is the same across sex groups.The adjusted school difference depends on sex.Fail to reject H0.

Decision for this example: G1, school and sex are statistically significant. The school × sex interaction is not significant. The final interpretation should focus on adjusted main effects, not on interaction storytelling.

Dataset and Variables Used

The worked example uses student performance data. The dependent variable is G3 final grade. The covariate is G1. The two categorical factors are school and sex. The SPSS output includes 649 valid cases.

VariableRoleLevels / TypeWhy It Matters
G3Dependent variableNumeric final gradeThe outcome being compared after adjustment.
G1CovariateNumeric earlier gradeControls for prior academic performance.
schoolFactor AGP, MSTests adjusted school difference.
sexFactor BF, MTests adjusted sex difference.
school × sexInteractionFour cellsTests whether the school effect depends on sex.

Raw Cell Means Before Covariate Adjustment

schoolsexNRaw G3 MeanRaw G1 MeanInterpretation
GPF23713.004212.2869Highest raw G3 cell mean.
GPM18612.032311.6022Lower than GP female but still above MS groups.
MSF14611.034210.5822Higher than MS male.
MSM809.95009.7875Lowest raw G3 cell mean.
TotalF38312.253311.6371Female raw mean is higher overall.
TotalM26611.406011.0564Male raw mean is lower overall.

The raw cell means show a strong pattern before adjustment: GP students have higher G3 means than MS students, and female students have higher G3 means than male students. ANCOVA then checks whether these differences remain after controlling for G1.

For supporting concepts, review Descriptive Statistics, Mean Median and Mode, Standard Deviation, Variance, Confidence Interval, P Value and Null and Alternative Hypothesis.

Two Way ANCOVA Assumptions

Two Way ANCOVA has the usual ANOVA assumptions plus additional covariate assumptions. The most important extra idea is that the covariate should have a reasonably linear relationship with the outcome and the covariate slope should be comparable across groups.

AssumptionWhat It MeansHow This Example Checks It
Continuous outcomeDependent variable should be numeric.G3 is a numeric final grade.
Categorical factorsIndependent variables should define groups.school and sex define four cells.
Covariate measured before or independentlyCovariate should not be an outcome caused by the factor treatment.G1 is an earlier grade used to adjust G3.
LinearityCovariate should relate linearly to the outcome.The G1 versus G3 scatterplot shows a strong positive relationship.
Homogeneity of regression slopesThe covariate slope should be reasonably similar across groups.Group-specific trend lines should be reviewed before final reporting.
Homogeneity of error varianceResidual variance should be reasonably similar across cells.SPSS Levene test reports p = .119, supporting no serious variance violation.
Residual diagnosticsResiduals should be approximately normal and randomly scattered.Residual and Q-Q plots show usable model fit with visible tail departures.

For deeper assumption checks, use Levene Test, Bartlett’s Test, Q-Q Plot Normality Check, P-P Plot Normality Check, Shapiro-Wilk Test, Studentized Residuals, Cook’s Distance and Outlier Detection.

Advertisement
Google AdSense middle placement reserved here

SPSS Output Interpretation for Two Way ANCOVA

The SPSS output uses UNIANOVA with G3 as the dependent variable, school and sex as fixed factors, and G1 as the covariate. The model is written as G3 = G1 + school + sex + school × sex.

SPSS Reading Order

SPSS Output AreaWhat to ReadWhy It Matters
Between-subject factorsschool_id and sex_id levels.Confirms GP/MS and F/M grouping.
Descriptive statisticsRaw G3 means for school × sex cells.Shows the unadjusted pattern.
Levene testF = 1.960, p = .119.Checks equality of error variances.
Tests of between-subject effectsG1, school, sex and school × sex rows.Main ANCOVA decision table.
Partial eta squaredEffect-size column.Shows practical strength after adjustment.
Parameter estimatesG1 slope and group estimates.Shows direction of covariate and group coding effects.

SPSS Type III ANCOVA Table

SourceType III SSdfMSFSig.Partial η²Interpretation
Corrected Model4648.27841162.069353.842< .001.687The full model is significant.
G13942.44213942.4421200.448< .001.651G1 is the dominant covariate.
school16.081116.0814.897.027.008Adjusted G3 differs by school.
sex14.492114.4924.413.036.007Adjusted G3 differs by sex.
school × sex.0021.002.001.979.000No adjusted interaction.
Error2114.9896443.284Residual error term.

SPSS Descriptive Pattern

The SPSS descriptive table shows that GP female students have the highest raw G3 mean at about 13.00, while MS male students have the lowest raw G3 mean at about 9.95. The total female mean is about 12.25, and the total male mean is about 11.41.

After controlling for G1, the adjusted means are closer together than the raw means, but the school and sex effects remain statistically significant. This is the central ANCOVA message: the group differences are smaller after adjustment, yet still detectable.

SPSS interpretation summary: The ANCOVA model is significant, R² = .687, adjusted R² = .685. G1 is a strong covariate, F(1, 644) = 1200.448, p < .001, partial η² = .651. School is significant, F(1, 644) = 4.897, p = .027, partial η² = .008. Sex is significant, F(1, 644) = 4.413, p = .036, partial η² = .007. The school × sex interaction is not significant, F(1, 644) = .001, p = .979.

Python Chart-by-Chart Interpretation

The Python chart sequence explains Two Way ANCOVA through adjusted means, covariate relationship, p-value decisions, partial eta squared, raw cell means and residual diagnostics.

Python Chart 1: Adjusted Means by School and Sex

Two Way ANCOVA Python adjusted means by school and sex
Python chart showing adjusted mean G3 by school and sex after controlling for average G1.

The adjusted mean chart shows GP higher than MS after covariate adjustment. Within both schools, female students have higher adjusted G3 means than male students.

The adjusted means are closer together than the raw means, which shows the effect of controlling for G1. The chart supports significant school and sex main effects but does not show a meaningful school × sex interaction.

Python Chart 2: Covariate Relationship Between G1 and G3

Two Way ANCOVA Python scatterplot of G1 and G3 by school
Python scatterplot showing the relationship between G1 and G3 across school groups.

The covariate plot shows a strong positive relationship between G1 and G3. Students with higher G1 scores generally have higher G3 scores. This explains why G1 has the largest partial eta squared in the ANCOVA model.

The school trend lines both rise, but they should be reviewed as part of the homogeneity of regression slopes assumption. The main model adjusts G3 at the average G1 level, so the covariate relationship is central to the analysis.

Python Chart 3: ANCOVA Effect p-values

Two Way ANCOVA Python p-value chart for school sex interaction and G1
Python chart showing p-values for school, sex, school × sex and G1.

The p-value chart shows that school, sex and G1 fall below the alpha = .05 line. The school × sex interaction is far above alpha.

This chart gives the main decision visually. The covariate is significant, both main effects are significant, and the interaction should not be interpreted as meaningful.

Python Chart 4: Partial Eta Squared by Effect

Two Way ANCOVA Python partial eta squared chart
Python chart showing partial eta squared for G1, school, sex and school × sex.

The effect-size chart shows that G1 dominates the model with partial eta squared around 0.651. School and sex are much smaller, each around 0.008.

This means the final report should separate statistical significance from practical size. G1 is the major explanatory variable, while school and sex are significant but small adjusted effects.

Python Chart 5: Raw Cell Means Before Covariate Adjustment

Two Way ANCOVA Python raw cell means before covariate adjustment
Python chart showing raw mean G3 by school and sex before adjusting for G1.

The raw mean chart shows wider group separation before covariate adjustment. GP female students have the highest raw mean, and MS male students have the lowest raw mean.

When this chart is compared with the adjusted means chart, the influence of G1 becomes clear. Covariate adjustment narrows the differences, but it does not remove the school and sex effects completely.

Python Chart 6: Residuals vs Fitted Values

Two Way ANCOVA Python residuals versus fitted values
Python residuals-versus-fitted plot for the Two Way ANCOVA model.

The residual plot shows most residuals scattered around zero across the fitted-value range. This supports the basic linear-model structure of the ANCOVA.

Some large negative residuals are visible, and one high positive residual appears on the left side. These points should be mentioned as diagnostic context, especially when writing a transparent assumptions section.

Python Chart 7: Residual Q-Q Plot

Two Way ANCOVA Python residual Q-Q plot
Python Q-Q plot showing residual normality context for the ANCOVA model.

The Q-Q plot shows that the middle residuals are closer to the reference line than the tails. The lower tail departs strongly from the line.

This means residual normality is approximate rather than perfect. With a large sample, the ANCOVA results can still be reported, but the lower-tail departure should be described honestly.

Python Chart 8: ANCOVA Summary Table

Two Way ANCOVA Python summary table with F p partial eta squared and decisions
Python summary table showing F values, p-values, partial eta squared and decisions.

The summary table confirms the final decision. G1, school and sex are significant, while school × sex is not significant.

This is the best Python table for final reporting because it gives the formal model effects, p-values, effect sizes and decisions in one place.

R Chart-by-Chart Validation

The R validation charts repeat the same ANCOVA workflow in a second software environment. The R images confirm the same decision pattern: G1 is the strongest effect, school and sex are significant adjusted effects, and the school × sex interaction is not significant.

R Chart 1: Adjusted Means by School and Sex

Two Way ANCOVA R adjusted means by school and sex
R validation chart showing adjusted G3 means by school and sex.

The R adjusted mean chart confirms the same pattern as Python. GP remains above MS, and female students remain above male students after controlling for G1.

This software agreement strengthens the adjusted main-effect interpretation.

R Chart 2: Covariate Relationship

Two Way ANCOVA R covariate relationship between G1 and G3
R validation scatterplot showing G1 and G3 relationship by school.

The R scatterplot confirms the strong positive relationship between G1 and G3. Higher G1 scores generally correspond to higher G3 scores.

This validates why G1 must be included as a covariate instead of comparing raw group means only.

R Chart 3: ANCOVA Effect p-values

Two Way ANCOVA R p-value summary chart
R validation p-value chart for G1, school, sex and school × sex.

The R p-value chart confirms the same decision structure: G1, school and sex are significant, while the interaction is not significant.

This supports a final report focused on adjusted main effects rather than interaction explanation.

R Chart 4: Partial Eta Squared by Effect

Two Way ANCOVA R partial eta squared chart
R validation chart showing partial eta squared for ANCOVA effects.

The R effect-size chart confirms that G1 has the dominant practical effect. School and sex are much smaller.

This helps prevent overstatement. The group effects are statistically significant, but G1 explains most of the adjusted variation.

R Chart 5: Raw Cell Means Before Adjustment

Two Way ANCOVA R raw cell means before adjustment
R validation chart showing raw G3 means before covariate adjustment.

The R raw mean chart confirms that raw group differences are larger before G1 adjustment.

This validates the ANCOVA logic: raw means are useful descriptively, but adjusted means are the correct focus of interpretation.

R Chart 6: Residuals vs Fitted Values

Two Way ANCOVA R residuals versus fitted values
R validation residuals-versus-fitted plot for the ANCOVA model.

The R residual plot confirms the same diagnostic message as Python. Most residuals are centered around zero, while some lower-tail residuals remain visible.

The model is useful for adjusted mean comparison, but diagnostics should be reported with caution about extreme residuals.

R Chart 7: Residual Q-Q Plot

Two Way ANCOVA R residual Q-Q plot
R validation Q-Q plot showing residual normality context.

The R Q-Q plot confirms that residual normality is approximate. The lower tail departs from the reference line.

This supports a transparent diagnostic statement in the final report.

R Chart 8: ANCOVA Summary Table

Two Way ANCOVA R summary table
R validation table showing G1, school, sex and school × sex decisions.

The R summary table confirms the same final interpretation. G1 is strongly significant, school and sex are significant, and school × sex is not significant.

The R table may show small numerical differences from the Python table because of implementation and table-format choices, but the statistical decisions are the same.

Advertisement
Google AdSense in-content placement reserved here

SPSS, R, Python and Excel Workflows for Two Way ANCOVA

The same Two Way ANCOVA workflow can be reproduced in SPSS, R, Python and Excel. SPSS uses the General Linear Model univariate procedure. R and Python use linear-model syntax with categorical factors and a covariate. Excel can prepare adjusted summaries and visuals, but SPSS, R or Python is recommended for the full ANCOVA table.

SPSS Workflow

StepSPSS Menu or SyntaxPurpose
Open dataFile > Open > DataLoad G3, G1, school and sex.
Open ANCOVA procedureAnalyze > General Linear Model > UnivariateRun ANCOVA as a univariate GLM.
Set outcomeDependent Variable: G3Define the final grade outcome.
Set fixed factorsschool and sexDefine the two categorical factors.
Set covariateG1Control earlier grade performance.
Choose full modelG1 + school + sex + school × sexTest adjusted main effects and interaction.
Request outputDescriptives, effect size, homogeneityGet means, partial eta squared and Levene test.
Export outputOUTPUT EXPORTSave SPSS output PDF.

R Workflow

StepR ActionPurpose
Read dataread.csv("dataset.csv")Load the dataset.
Convert factorsfactor(school), factor(sex)Define categorical variables.
Fit modellm(G3 ~ G1 + school * sex)Run the ANCOVA model.
ANOVA tableanova(model) or car::Anova()Get effect tests.
Adjusted meansemmeans::emmeans()Estimate adjusted group means.
DiagnosticsResidual and Q-Q plotsCheck assumptions.

Python Workflow

StepPython ActionPurpose
Read datapandas.read_csv()Load G3, G1, school and sex.
Fit OLS modelG3 ~ G1 + C(school) * C(sex)Run the two-way ANCOVA model.
ANOVA tableanova_lm(model, typ=2)Get F values and p-values.
Effect sizesCalculate partial eta squaredReport practical size.
Adjusted meansPredict at average G1 for each cellVisualize covariate-adjusted means.
DiagnosticsResiduals vs fitted and Q-Q plotCheck residual assumptions.

Excel Workflow

Excel TaskFormula or ToolPurpose
Prepare dataColumns for G3, G1, school and sexOrganize the ANCOVA dataset.
Create raw PivotTableRows = school, Columns = sex, Values = Average G3Show unadjusted means.
Estimate regression modelData Analysis ToolPak or formulasApproximate adjusted model.
Calculate adjusted predictionsUse model coefficients at mean G1Create adjusted means.
Create chartsBar charts and scatterplotsVisualize raw and adjusted patterns.
Formal ANCOVAUse SPSS, R or PythonExcel is limited for full ANCOVA reporting.

Code Blocks for Two Way ANCOVA

SPSS Syntax for Two Way ANCOVA

* Two Way ANCOVA in SPSS.
* Dependent variable: G3.
* Factors: school and sex.
* Covariate: G1.

TITLE "Two Way ANCOVA: G3 by School and Sex Controlling for G1".

UNIANOVA G3 BY school sex WITH G1
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /PRINT=DESCRIPTIVE ETASQ HOMOGENEITY PARAMETER
  /EMMEANS=TABLES(school*sex) WITH(G1=MEAN)
  /EMMEANS=TABLES(school) WITH(G1=MEAN) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(sex) WITH(G1=MEAN) COMPARE ADJ(LSD)
  /CRITERIA=ALPHA(.05)
  /DESIGN=G1 school sex school*sex.

OUTPUT EXPORT
  /CONTENTS EXPORT=VISIBLE
  /PDF DOCUMENTFILE="two_way_ancova_spss_output.pdf".

Python Code for Two Way ANCOVA

import pandas as pd
import statsmodels.api as sm
from statsmodels.formula.api import ols
from statsmodels.stats.anova import anova_lm

df = pd.read_csv("dataset.csv")

df["G3"] = pd.to_numeric(df["G3"], errors="coerce")
df["G1"] = pd.to_numeric(df["G1"], errors="coerce")
df["school"] = df["school"].astype("category")
df["sex"] = df["sex"].astype("category")

data = df[["G3", "G1", "school", "sex"]].dropna().copy()

model = ols("G3 ~ G1 + C(school) * C(sex)", data=data).fit()

anova_table = anova_lm(model, typ=2)
error_ss = anova_table.loc["Residual", "sum_sq"]
anova_table["partial_eta_sq"] = anova_table["sum_sq"] / (anova_table["sum_sq"] + error_ss)

print(anova_table)
print(model.summary())

# Adjusted means at average G1
mean_g1 = data["G1"].mean()
cells = pd.DataFrame(
    [(s, x, mean_g1) for s in data["school"].cat.categories for x in data["sex"].cat.categories],
    columns=["school", "sex", "G1"]
)
cells["adjusted_G3"] = model.predict(cells)
print(cells)

# Raw means for comparison
print(data.groupby(["school", "sex"])["G3"].mean())

# Residual diagnostics
data["fitted"] = model.fittedvalues
data["residual"] = model.resid
print(data[["G3", "G1", "school", "sex", "fitted", "residual"]].head())

R Code for Two Way ANCOVA

# Two Way ANCOVA in R

library(tidyverse)

df <- read.csv("dataset.csv")

df$G3 <- as.numeric(df$G3)
df$G1 <- as.numeric(df$G1)
df$school <- as.factor(df$school)
df$sex <- as.factor(df$sex)

data <- df %>%
  select(G3, G1, school, sex) %>%
  drop_na()

model <- lm(G3 ~ G1 + school * sex, data = data)

anova(model)
summary(model)

# Optional Type III ANOVA
# install.packages("car")
# library(car)
# Anova(model, type = 3)

# Adjusted means
# install.packages("emmeans")
# library(emmeans)
# emmeans(model, ~ school * sex)

# Raw means
data %>%
  group_by(school, sex) %>%
  summarise(
    n = n(),
    raw_mean_G3 = mean(G3),
    mean_G1 = mean(G1),
    .groups = "drop"
  )

# Diagnostics
par(mfrow = c(1, 2))
plot(fitted(model), residuals(model),
     xlab = "Fitted values", ylab = "Residuals",
     main = "Residuals vs Fitted")
abline(h = 0, lty = 2)
qqnorm(residuals(model))
qqline(residuals(model))

Excel Notes for Two Way ANCOVA

Excel support workflow:

1. Arrange the data:
   G3 | G1 | school | sex

2. Create raw cell means:
   PivotTable:
   Rows = school
   Columns = sex
   Values = average of G3

3. Calculate covariate mean:
   mean_G1 = AVERAGE(G1_range)

4. Fit a regression model:
   G3 = intercept + G1 + school dummy + sex dummy + school*sex dummy

5. Calculate adjusted cell means:
   Use the regression equation with G1 fixed at mean_G1.

6. Create charts:
   - raw cell means
   - adjusted means
   - G1 vs G3 scatterplot
   - residuals vs fitted
   - Q-Q plot if available

7. Formal ANCOVA:
   Use SPSS, R or Python for the official Type III ANCOVA table.

APA Reporting Wording

When reporting Two Way ANCOVA, include the outcome, two factors, covariate, adjusted mean interpretation, interaction decision, effect sizes and assumption notes. The school × sex interaction should not be interpreted as meaningful because its p-value is almost 1.

APA-style report: A two-way ANCOVA was conducted to examine adjusted G3 final grade differences by school and sex while controlling for G1. The covariate G1 was significant, F(1, 644) = 1200.448, p < .001, partial η² = .651. After controlling for G1, the school effect was significant, F(1, 644) = 4.897, p = .027, partial η² = .008, and the sex effect was significant, F(1, 644) = 4.413, p = .036, partial η² = .007. The school × sex interaction was not significant, F(1, 644) = .001, p = .979, partial η² = .000. These results indicate significant adjusted main effects of school and sex, with no evidence that the adjusted school difference depends on sex.

Short reporting version: After adjusting for G1, G3 differed significantly by school and sex. The school × sex interaction was not significant, so the final interpretation should focus on adjusted main effects.

Common Mistakes

MistakeWhy It Is WrongCorrect Practice
Calling Two Way ANCOVA the same as Two Way ANOVAANCOVA adjusts for a covariate; ANOVA does not.Compare with One Way ANOVA and ANCOVA.
Interpreting raw means as final resultsANCOVA decisions are based on adjusted means.Report adjusted means after controlling for G1.
Overstating the school × sex interactionThe interaction p-value is .979.Report the interaction as non-significant.
Ignoring the covariate effectG1 has partial η² around .651.Explain that G1 is the dominant predictor.
Skipping homogeneity of slopesANCOVA assumes comparable covariate slopes across groups.Check covariate × factor interactions or review trend lines.
Reporting only p-valuesP-values do not show practical size.Report ANOVA Effect Size, Eta Squared or Omega Squared.

When to Use Two Way ANCOVA

Use Two Way ANCOVA when you have one numeric outcome, two categorical factors and at least one numeric covariate that should be statistically controlled. It is common in education, psychology, medicine, business testing and social science research.

SituationUse Two Way ANCOVA?Reporting Note
One outcome, two factors and one covariateYesUse a two-factor ANCOVA model.
One outcome and two factors with no covariateNoUse two-way ANOVA or factorial ANOVA.
One factor and one covariateNoUse One Way ANCOVA.
Three categorical factors and no covariateNoUse Three Way ANOVA.
Repeated measurements are involvedUse mixed ANCOVA or mixed modelCompare with Mixed ANOVA and Mixed MANOVA.

Two Way ANCOVA should be compared with One Way ANCOVA, ANCOVA, Factorial ANOVA, Fixed Effects ANOVA, ANOVA Assumptions, ANOVA in SPSS, ANOVA in R, ANOVA in Python, F Distribution, and Statistical Power.

Downloads and Resources for Two Way ANCOVA

Use these resources to reproduce the Two Way ANCOVA workflow. The Python report, R report and SPSS output PDF are included as verification files. Script and workbook placeholders can be replaced after the final downloadable files are uploaded to the WordPress Media Library.

FAQs About Two Way ANCOVA

What is Two Way ANCOVA?

Two Way ANCOVA is an analysis of covariance model that compares a numeric outcome across two categorical factors after controlling for one or more covariates.

What variables were used in this example?

The outcome was G3 final grade, the factors were school and sex, and the covariate was G1.

Was the covariate G1 significant?

Yes. G1 was highly significant and had the largest partial eta squared value in the model.

Was school significant after controlling for G1?

Yes. School remained significant after controlling for G1.

Was sex significant after controlling for G1?

Yes. Sex remained significant after controlling for G1.

Was the school by sex interaction significant?

No. The school × sex interaction was not significant, with p around .979.

What does adjusted mean mean in ANCOVA?

An adjusted mean is a group mean estimated after holding the covariate constant, usually at the covariate’s overall mean.

How is Two Way ANCOVA different from Two Way ANOVA?

Two Way ANOVA compares raw group means across two factors. Two Way ANCOVA compares adjusted means after controlling for a covariate.

Can Two Way ANCOVA be done in Excel?

Excel can support raw means, regression approximations and charts, but SPSS, R or Python is recommended for the formal ANCOVA table.

How do I report this Two Way ANCOVA in APA style?

A concise report is: After controlling for G1, school and sex were significant predictors of G3, while the school × sex interaction was not significant.

Need help applying this to your own data?

Salar Cafe can help interpret output, clean datasets, review assumptions, build dashboards and explain statistical results ethically.

Need help interpreting your data analysis results?

Contact Salar Cafe
Engr. Muhammad Yar Saqib author profile photo

Engr. Muhammad Yar Saqib

WhatsApp Get Data Analysis Help