Knowledge Base / Analysis of Covariance (ANCOVA) Inferential Statistics 78 min read

Analysis of Covariance (ANCOVA)

Comprehensive reference guide for Analysis of Covariance (ANCOVA) statistical technique.

ANCOVA: Zero to Hero Tutorial

This comprehensive tutorial takes you from the foundational concepts of covariance adjustment all the way through the mathematics, assumptions, effect sizes, post-hoc testing, non-parametric alternatives, interpretation, reporting, and practical usage of the Analysis of Covariance (ANCOVA) within the DataStatPro application. Whether you are encountering ANCOVA for the first time or seeking a rigorous, unified understanding of covariate-adjusted between-groups inference, this guide builds your knowledge systematically from the ground up.


Table of Contents

  1. Prerequisites and Background Concepts
  2. What is ANCOVA?
  3. The Mathematics Behind ANCOVA
  4. Assumptions of ANCOVA
  5. Variants of ANCOVA
  6. Using the ANCOVA Calculator Component
  7. Full Step-by-Step Procedure
  8. Effect Sizes for ANCOVA
  9. Post-Hoc Tests and Planned Contrasts
  10. Confidence Intervals
  11. Power Analysis and Sample Size Planning
  12. Non-Parametric Alternative: Quade and Ranked ANCOVA
  13. Advanced Topics
  14. Worked Examples
  15. Common Mistakes and How to Avoid Them
  16. Troubleshooting
  17. Quick Reference Cheat Sheet

1. Prerequisites and Background Concepts

Before diving into ANCOVA, it is essential to be comfortable with the following foundational statistical concepts. Each is briefly reviewed below.

1.1 From One-Way ANOVA to ANCOVA

One-Way ANOVA tests whether group means on a dependent variable (DV) differ beyond what chance alone would produce. However, ANOVA assumes that groups are equivalent on all variables except the independent variable (IV) — an assumption satisfied by random assignment in experiments, but rarely in observational research.

ANCOVA extends ANOVA by:

  1. Statistically controlling for one or more continuous covariates (CVs) that are correlated with the DV.
  2. Removing covariate-related variance from the error term, increasing statistical power.
  3. Adjusting group means to what they would be if all groups had identical covariate scores — producing adjusted means (also called estimated marginal means).

1.2 What is a Covariate?

A covariate (also called a concomitant variable) is a continuous variable that:

Examples:

The covariate should be chosen on theoretical grounds, not selected post-hoc because it "improves" the results. Including irrelevant covariates reduces power by consuming degrees of freedom.

1.3 The Two Goals of ANCOVA

ANCOVA serves two distinct but related purposes, and understanding which goal applies to your study is critical for correct interpretation:

Goal 1 — Increase Statistical Power (Experimental Designs)

In randomised experiments, groups are equal on average at baseline (including on the covariate). Including a covariate reduces MSerrorMS_{error} by removing variance explained by the covariate from the residual. This shrinks the denominator of the F-ratio, increasing power to detect treatment effects.

Goal 2 — Statistical Control (Quasi-Experimental and Observational Designs)

In non-randomised designs, groups may differ on the covariate at baseline. ANCOVA adjusts group means to a common covariate value, providing a partial statistical control for pre-existing differences. However, this control is imperfect and cannot fully substitute for randomisation.

⚠️ These two goals have different interpretational requirements. For Goal 1 (randomised experiments), ANCOVA assumptions are easily met and interpretation is straightforward. For Goal 2 (observational designs), the assumption of covariate independence from group membership is violated by design, requiring careful interpretational caveats about residual confounding.

1.4 The Regression Foundation of ANCOVA

ANCOVA is a special case of the General Linear Model (GLM):

Yi=μ+τj+β(XiXˉ)+εiY_i = \mu + \tau_j + \beta(X_i - \bar{X}) + \varepsilon_i

Where:

This is equivalent to a multiple regression model with group dummy codes and the covariate as predictors. The F-test for the group effect in ANCOVA tests whether groups differ after partialling out the covariate.

1.5 Variance Partitioning in ANCOVA

ANCOVA partitions the total sum of squares differently from ANOVA:

SStotal=SSbetween(adj)+SScovariate+SSwithin(adj)SS_{total} = SS_{between(adj)} + SS_{covariate} + SS_{within(adj)}

The covariate "absorbs" variance from the error term. The adjusted within-groups SS (SSwithin(adj)SS_{within(adj)}) is smaller than the unadjusted SSwithinSS_{within}, leading to a smaller MSerrorMS_{error} and greater power — provided the covariate is genuinely correlated with the DV.

1.6 Adjusted Means

The core output of ANCOVA is the adjusted group mean — the estimated group mean after removing the linear effect of the covariate:

Yˉj(adj)=Yˉjβ^(XˉjXˉ..)\bar{Y}_{j(adj)} = \bar{Y}_j - \hat{\beta}(\bar{X}_j - \bar{X}_{..})

Where:

The adjusted mean represents what the group mean would have been if all groups had the same average covariate score (Xˉ..\bar{X}_{..}). These are also called Estimated Marginal Means (EMMs) and are the primary means for interpretation and post-hoc testing in ANCOVA.

1.7 The Homogeneity of Regression Slopes Assumption

Unlike ANOVA, ANCOVA carries a critical additional assumption: the within-group regression slope of YY on XX must be the same in all KK groups. If the slope varies across groups, the covariate adjustment is non-uniform, the ANCOVA F-test is invalid, and an interaction model (covariate × group) is more appropriate. This is the most commonly violated and overlooked ANCOVA assumption.

1.8 ANCOVA vs. Gain Score Analysis

A common alternative to ANCOVA for pre-post designs is to compute gain scores (post − pre) and run a one-way ANOVA. The choice between ANCOVA and gain score analysis depends on the reliability and variability of the pre-test:


2. What is ANCOVA?

2.1 The Core Idea

Analysis of Covariance (ANCOVA) is a parametric inferential procedure that combines one-way ANOVA with linear regression. It tests whether the adjusted means of K2K \geq 2 independent groups are simultaneously equal, after statistically controlling for one or more continuous covariates.

The ANCOVA omnibus null hypothesis:

H0:μ1(adj)=μ2(adj)==μK(adj)H_0: \mu_{1(adj)} = \mu_{2(adj)} = \cdots = \mu_{K(adj)}

H1:At least one adjusted mean μj(adj) differs from the othersH_1: \text{At least one adjusted mean } \mu_{j(adj)} \text{ differs from the others}

The adjusted means are population means evaluated at the grand mean of the covariate:

μj(adj)=μjβ(μXjμX)\mu_{j(adj)} = \mu_j - \beta(\mu_{X_j} - \mu_X)

2.2 What ANCOVA Tests and Does Not Test

ANCOVA tells you:

ANCOVA does NOT tell you:

2.3 Design Requirements

For a one-way between-subjects ANCOVA, the design must satisfy:

2.4 ANCOVA in Context

SituationTest
K2K \geq 2 groups, no covariates, normal, equal variancesOne-Way ANOVA
K2K \geq 2 groups, no covariates, normal, unequal variancesWelch's One-Way ANOVA
K2K \geq 2 groups, one or more continuous covariates, normalANCOVA
K2K \geq 2 groups, covariate, unequal slopes across groupsANCOVA with interaction (Johnson-Neyman)
K2K \geq 2 groups, covariate, non-normal or ordinal DVQuade test / Ranked ANCOVA
2\geq 2 IVs, one or more covariatesFactorial ANCOVA
K2K \geq 2 conditions, repeated measures, covariateANCOVA with repeated measures
Continuous IV, continuous DV, continuous moderatorModerated regression
2\geq 2 DVs, one or more covariatesMANCOVA

2.5 Real-World Applications

FieldExample ApplicationIV (Levels)CovariateDV
Clinical PsychologyCBT vs. BA vs. Waitlist3 therapy conditionsPre-treatment PHQ-9Post-treatment PHQ-9
Education3 teaching methods3 conditionsPre-test scorePost-test score
Medicine3 drug doses vs. placebo4 groupsBaseline BPPost-treatment BP
Neuroscience3 sleep conditions3 groupsAgeReaction time
HR/OB3 leadership styles3 groupsJob experienceProductivity
Nutrition4 diet types4 groupsBaseline weightWeight loss
Marketing5 ad formats5 groupsPrior brand attitudePurchase intent
Epidemiology3 intervention programmes3 groupsSES scoreHealth outcome

3. The Mathematics Behind ANCOVA

3.1 Notation

SymbolMeaning
KKNumber of groups
njn_jSample size in group jj
N=j=1KnjN = \sum_{j=1}^K n_jTotal sample size
ppNumber of covariates
xijx_{ij}Covariate score for participant ii in group jj (single covariate)
yijy_{ij}DV score for participant ii in group jj
xˉj\bar{x}_jMean covariate score in group jj
xˉ..\bar{x}_{..}Grand mean of the covariate
yˉj\bar{y}_jObserved (unadjusted) mean of DV in group jj
yˉj(adj)\bar{y}_{j(adj)}Adjusted mean of DV in group jj
β^\hat{\beta}Pooled within-group regression slope of YY on XX
βj\beta_jWithin-group slope in group jj (for homogeneity test)
MSerror(adj)MS_{error(adj)}Adjusted within-groups mean square (error after covariate removal)

3.2 The Within-Group Regression Coefficient

ANCOVA uses the pooled within-group regression coefficient β^\hat{\beta}, computed from the pooled within-group sums of cross-products:

Within-group sum of squares for the covariate:

SSXX(W)=j=1Ki=1nj(xijxˉj)2SS_{XX(W)} = \sum_{j=1}^K\sum_{i=1}^{n_j}(x_{ij} - \bar{x}_j)^2

Within-group sum of cross-products (covariate × DV):

SPXY(W)=j=1Ki=1nj(xijxˉj)(yijyˉj)SP_{XY(W)} = \sum_{j=1}^K\sum_{i=1}^{n_j}(x_{ij} - \bar{x}_j)(y_{ij} - \bar{y}_j)

Pooled within-group regression coefficient:

β^=SPXY(W)SSXX(W)\hat{\beta} = \frac{SP_{XY(W)}}{SS_{XX(W)}}

This slope represents the average linear relationship between the covariate and DV within groups, pooled across all KK groups. It is equivalent to the slope obtained from a regression of YY on XX with all between-group variance removed.

3.3 Adjusted Group Means

The adjusted group mean for group jj:

yˉj(adj)=yˉjβ^(xˉjxˉ..)\bar{y}_{j(adj)} = \bar{y}_j - \hat{\beta}(\bar{x}_j - \bar{x}_{..})

Interpretation: The adjusted mean is the estimated group mean when the group's covariate mean equals the grand mean of the covariate. It answers: "What would Group jj's mean DV score be if they had, on average, the same covariate score as the entire sample?"

Adjusted grand mean:

yˉ..(adj)=j=1Knjyˉj(adj)N=yˉ..\bar{y}_{..(adj)} = \frac{\sum_{j=1}^K n_j \bar{y}_{j(adj)}}{N} = \bar{y}_{..}

The adjusted grand mean equals the unadjusted grand mean (covariate adjustment preserves the overall mean).

3.4 Sum of Squares Decomposition in ANCOVA

ANCOVA involves computing adjusted sums of squares by removing the linear effect of the covariate from both the total and within-group SS.

Total sum of squares for DV (unadjusted):

SSYY(T)=j=1Ki=1nj(yijyˉ..)2SS_{YY(T)} = \sum_{j=1}^K\sum_{i=1}^{n_j}(y_{ij} - \bar{y}_{..})^2

Within-group sum of squares for DV (unadjusted):

SSYY(W)=j=1Ki=1nj(yijyˉj)2=j=1K(nj1)syj2SS_{YY(W)} = \sum_{j=1}^K\sum_{i=1}^{n_j}(y_{ij} - \bar{y}_j)^2 = \sum_{j=1}^K(n_j-1)s_{y_j}^2

Total sum of squares for covariate:

SSXX(T)=j=1Ki=1nj(xijxˉ..)2SS_{XX(T)} = \sum_{j=1}^K\sum_{i=1}^{n_j}(x_{ij} - \bar{x}_{..})^2

Total sum of cross-products:

SPXY(T)=j=1Ki=1nj(xijxˉ..)(yijyˉ..)SP_{XY(T)} = \sum_{j=1}^K\sum_{i=1}^{n_j}(x_{ij} - \bar{x}_{..})(y_{ij} - \bar{y}_{..})

Adjusted within-groups SS (error after covariate removal):

SSwithin(adj)=SSYY(W)SPXY(W)2SSXX(W)SS_{within(adj)} = SS_{YY(W)} - \frac{SP_{XY(W)}^2}{SS_{XX(W)}}

The second term is the reduction in error SS due to the covariate. It equals β^2×SSXX(W)\hat{\beta}^2 \times SS_{XX(W)} — the within-group regression of YY on XX.

Adjusted total SS:

SStotal(adj)=SSYY(T)SPXY(T)2SSXX(T)SS_{total(adj)} = SS_{YY(T)} - \frac{SP_{XY(T)}^2}{SS_{XX(T)}}

Adjusted between-groups SS:

SSbetween(adj)=SStotal(adj)SSwithin(adj)SS_{between(adj)} = SS_{total(adj)} - SS_{within(adj)}

Verification:

SSbetween(adj)=SStotal(adj)SSwithin(adj)SS_{between(adj)} = SS_{total(adj)} - SS_{within(adj)}

Note: In ANCOVA, SStotal(adj)SSbetween(adj)+SSwithin(adj)SS_{total(adj)} \neq SS_{between(adj)} + SS_{within(adj)} if computed from raw unadjusted SS — it is the adjusted versions that sum correctly.

3.5 Degrees of Freedom

Sourcedfdf
Between groups (adjusted)K1K - 1
Covariatepp (number of covariates)
Within groups / Error (adjusted)NKpN - K - p
Total (adjusted)N1pN - 1 - p

The key difference from ANOVA: the error dfdf is reduced by pp (one per covariate), because each covariate costs one degree of freedom to estimate its slope. This is why including irrelevant covariates (low correlation with DV) reduces power despite removing some variance.

Power gain from covariate requires:

rXY2(NKp)1>p1\frac{r^2_{XY}(N - K - p)}{1} > \frac{p}{1}

Simplified: the covariate must explain more variance than the dfdf it consumes. For a single covariate (p=1p = 1), any rXY>0|r_{XY}| > 0 provides power gain when NN is large enough.

Break-even correlation for a single covariate:

rbreakeven2=1NKr^2_{break-even} = \frac{1}{N - K}

For N=60N = 60, K=3K = 3: rbreakeven=1/57=0.133r_{break-even} = \sqrt{1/57} = 0.133. Any rXY>0.133|r_{XY}| > 0.133 within groups yields higher power from ANCOVA than from one-way ANOVA.

3.6 Mean Squares and the F-Ratio

Adjusted between-groups mean square:

MSbetween(adj)=SSbetween(adj)K1MS_{between(adj)} = \frac{SS_{between(adj)}}{K-1}

Adjusted within-groups mean square (adjusted error variance):

MSerror(adj)=SSwithin(adj)NKpMS_{error(adj)} = \frac{SS_{within(adj)}}{N - K - p}

The ANCOVA F-statistic:

F=MSbetween(adj)MSerror(adj)F = \frac{MS_{between(adj)}}{MS_{error(adj)}}

Under H0H_0: FFK1,  NKpF \sim F_{K-1,\;N-K-p}

p-value:

p=P(FK1,  NKpFobs)p = P(F_{K-1,\;N-K-p} \geq F_{obs})

3.7 The F-Test for the Covariate

ANCOVA also produces an F-test for the covariate itself:

Fcov=SScovariate/pMSerror(adj)F_{cov} = \frac{SS_{covariate}/p}{MS_{error(adj)}}

Where:

SScovariate=β^2×SSXX(W)=SPXY(W)2SSXX(W)SS_{covariate} = \hat{\beta}^2 \times SS_{XX(W)} = \frac{SP_{XY(W)}^2}{SS_{XX(W)}}

This tests whether the pooled within-group regression slope β^\hat{\beta} is significantly different from zero. A non-significant covariate F-test suggests the covariate is not linearly related to the DV within groups, and including it may reduce power.

3.8 The ANCOVA Source Table

SourceSSdfdfMSFFpp
Covariate (XX)SScovSS_{cov}ppMScov=SScov/pMS_{cov} = SS_{cov}/pMScov/MSerr(adj)MS_{cov}/MS_{err(adj)}P(FFcov)P(F \geq F_{cov})
Between groups (adjusted)SSB(adj)SS_{B(adj)}K1K-1MSB(adj)MS_{B(adj)}MSB(adj)/MSerr(adj)MS_{B(adj)}/MS_{err(adj)}P(FFobs)P(F \geq F_{obs})
Error (adjusted)SSW(adj)SS_{W(adj)}NKpN-K-pMSerr(adj)MS_{err(adj)}
Total (adjusted)SST(adj)SS_{T(adj)}N1pN-1-p

3.9 Computing the Pooled Within-Group Correlation

The pooled within-group correlation between the covariate and DV:

rXY(W)=SPXY(W)SSXX(W)×SSYY(W)r_{XY(W)} = \frac{SP_{XY(W)}}{\sqrt{SS_{XX(W)} \times SS_{YY(W)}}}

This correlation quantifies the linear relationship between covariate and DV within groups, pooled across groups. It determines how much variance the covariate removes from the error term.

Percentage of within-group variance explained by covariate:

rXY(W)2=SPXY(W)2SSXX(W)×SSYY(W)r^2_{XY(W)} = \frac{SP_{XY(W)}^2}{SS_{XX(W)} \times SS_{YY(W)}}

Percentage reduction in error SS:

SSYY(W)SSwithin(adj)SSYY(W)=rXY(W)2\frac{SS_{YY(W)} - SS_{within(adj)}}{SS_{YY(W)}} = r^2_{XY(W)}

3.10 Adjusted Standard Error for Adjusted Means

The standard error of an adjusted group mean:

SEj(adj)=MSerror(adj)(1nj+(xˉjxˉ..)2SSXX(W))SE_{j(adj)} = \sqrt{MS_{error(adj)}\left(\frac{1}{n_j} + \frac{(\bar{x}_j - \bar{x}_{..})^2}{SS_{XX(W)}}\right)}

The second term inside the square root captures additional uncertainty from the fact that the covariate mean of group jj may deviate from the grand mean. When xˉj=xˉ..\bar{x}_j = \bar{x}_{..}, this term vanishes and SEj(adj)=MSerror(adj)/njSE_{j(adj)} = \sqrt{MS_{error(adj)}/n_j}.

3.11 Multiple Covariates

With pp covariates, the ANCOVA model becomes:

Yi=μ+τj+β1(X1iXˉ1)+β2(X2iXˉ2)++βp(XpiXˉp)+εiY_i = \mu + \tau_j + \beta_1(X_{1i} - \bar{X}_1) + \beta_2(X_{2i} - \bar{X}_2) + \cdots + \beta_p(X_{pi} - \bar{X}_p) + \varepsilon_i

The adjusted SS are computed using matrix algebra (the GLM framework):

SSwithin(adj)=SSYY(W)bSXX(W)bSS_{within(adj)} = SS_{YY(W)} - \mathbf{b}'\mathbf{S}_{XX(W)}\mathbf{b}

Where b=SXX(W)1sXY(W)\mathbf{b} = \mathbf{S}_{XX(W)}^{-1}\mathbf{s}_{XY(W)} is the vector of pooled within-group regression coefficients, SXX(W)\mathbf{S}_{XX(W)} is the pooled within-group covariance matrix of covariates, and sXY(W)\mathbf{s}_{XY(W)} is the pooled within-group covariance vector between covariates and DV.

DataStatPro handles multiple covariates automatically using matrix algebra in its GLM engine.

3.12 Computing Effect Sizes from the ANCOVA Table

Partial eta squared (from F):

ηp2=FdfBFdfB+dferror(adj)\eta^2_p = \frac{F \cdot df_B}{F \cdot df_B + df_{error(adj)}}

Partial omega squared (bias-corrected, preferred):

ωp2(F1)(K1)(F1)(K1)+N\omega^2_p \approx \frac{(F-1)(K-1)}{(F-1)(K-1) + N}

Exact partial omega squared (from SS):

ωp2=SSB(adj)(K1)MSerror(adj)SST(adj)+MSerror(adj)\omega^2_p = \frac{SS_{B(adj)} - (K-1)MS_{error(adj)}}{SS_{T(adj)} + MS_{error(adj)}}


4. Assumptions of ANCOVA

ANCOVA carries all the assumptions of one-way ANOVA plus three additional covariate-specific assumptions. Violating the covariate assumptions is more consequential than violating standard ANOVA assumptions.

4.1 Normality of Residuals

The adjusted residuals eij=yijyˉj(adj)β^(xijxˉj)e_{ij} = y_{ij} - \bar{y}_{j(adj)} - \hat{\beta}(x_{ij} - \bar{x}_j) must be normally distributed within each group.

How to check:

Robustness: ANCOVA is robust to mild non-normality, especially with balanced designs and nj20n_j \geq 20 per group. The robustness applies to the F-test for the group effect; tests on the covariate coefficient are also robust with moderate NN.

When violated: Use the Quade test (non-parametric ANCOVA) or ranked ANCOVA as described in Section 12. Consider log or square root transformations for right-skewed DVs.

4.2 Homogeneity of Variance (Homoscedasticity)

The adjusted within-group variances must be equal across all KK groups:

σ1(adj)2=σ2(adj)2==σK(adj)2\sigma^2_{1(adj)} = \sigma^2_{2(adj)} = \cdots = \sigma^2_{K(adj)}

This applies to the residuals after removing the covariate effect.

How to check:

When violated: Use a heteroscedastic ANCOVA (Welch-type adjustment) or non-parametric alternatives. Report the violation and the robust alternative results alongside standard ANCOVA results.

4.3 Independence of Observations

All observations must be independent within and across groups. This is a design assumption that cannot be tested from data.

Common violations:

When violated: Use multilevel ANCOVA (covariate in mixed-effects model) or repeated measures ANCOVA.

4.4 Interval Scale of Measurement

Both the DV and the covariate(s) must be measured on at least an interval scale. The covariate must be continuous or at minimum have many ordered categories.

When violated for DV: Use the Quade test or ranked ANCOVA.

When violated for covariate: If the covariate is binary (0/1), include it as a categorical factor rather than a continuous covariate (use two-way ANOVA or ANCOVA with the binary variable as a blocking factor).

4.5 Homogeneity of Regression Slopes ⭐ CRITICAL

The most important ANCOVA-specific assumption: the within-group regression slope of YY on XX must be the same in all KK groups:

β1=β2==βK=β\beta_1 = \beta_2 = \cdots = \beta_K = \beta

Why this matters: ANCOVA uses a single pooled slope β^\hat{\beta} to adjust all group means. If the true slopes differ across groups, the single adjustment is incorrect for at least some groups — the adjusted means are meaningless.

Conceptually: The homogeneity of regression slopes assumption requires that the covariate-DV relationship is parallel across groups. Heterogeneous slopes indicate a covariate × group interaction — the effect of the covariate on the DV differs depending on group membership.

How to check:

When violated:

4.6 Independence of Covariate and Treatment (Group Membership)

For ANCOVA to provide valid adjusted means, the covariate must be independent of (i.e., not caused by) the treatment. Specifically:

How to check:

When violated (covariate influenced by treatment):

4.7 Linearity of Covariate-DV Relationship

ANCOVA assumes the relationship between the covariate and DV is linear within each group. Non-linear relationships are not fully removed by the linear adjustment, leaving residual covariate variance in the error term.

How to check:

When violated:

4.8 Reliability of the Covariate

ANCOVA assumes the covariate is measured without error. In practice, all psychological and behavioural measures contain measurement error. Measurement error in the covariate causes incomplete adjustment — residual confounding remains even after ANCOVA.

Consequences of covariate unreliability:

Remedy:

4.9 Absence of Influential Outliers

Outliers on the covariate or DV can distort β^\hat{\beta} and the adjusted means substantially.

How to check:

4.10 Assumption Summary Table

AssumptionDescriptionHow to CheckRemedy if Violated
NormalityAdjusted residuals N(0,σ2)\sim \mathcal{N}(0, \sigma^2)Shapiro-Wilk, Q-Q plotQuade test; transform DV
HomoscedasticityEqual adjusted within-group variancesLevene's (on residuals)Heteroscedastic ANCOVA
IndependenceObservations independent within and across groupsDesign reviewMultilevel ANCOVA
Interval scale (DV & CV)Both DV and covariate have equal-interval propertiesMeasurement theoryRanked ANCOVA; Quade test
Homogeneity of regression slopesSame β\beta in all groupsInteraction F-test; parallel scatterplotsJohnson-Neyman; moderated regression
Independence of covariate and treatmentCovariate not caused by treatmentCovariate balance test; timing of measurementUse pre-treatment covariates only
LinearityLinear YY-on-XX relationship within groupsScatterplots; residual plots; polynomial testAdd X2X^2; transform covariate
Covariate reliabilityCovariate measured without substantial errorReport reliability coefficientReliability-corrected ANCOVA
No outliersNo extreme influential observationsCook's DD, leverage, studentised residualsInvestigate; report sensitivity analysis

5. Variants of ANCOVA

5.1 Standard One-Way ANCOVA

The default ANCOVA with a single continuous covariate, assuming homogeneity of regression slopes, normality of adjusted residuals, and homoscedasticity. Uses the pooled within-group regression slope for adjustment. This is appropriate when all assumptions are met.

5.2 ANCOVA with Multiple Covariates

When two or more covariates are available and each contributes unique variance to the DV, including all of them in ANCOVA maximises power. The mathematical extension uses multiple regression within the GLM framework (Section 3.11).

Guidelines for multiple covariates:

5.3 Welch-Type Heteroscedastic ANCOVA

Analogous to Welch's one-way ANOVA, this variant relaxes the assumption of equal adjusted within-group variances. It uses group-specific variance estimates in the F-test denominator, with Welch-Satterthwaite degrees of freedom correction.

DataStatPro implements heteroscedastic ANCOVA using the HC3 heteroscedasticity- consistent variance estimator for the group effect test.

Use when: Levene's test on adjusted residuals is significant (especially with unequal njn_j).

5.4 ANCOVA with Categorical Covariate (Blocking Factor)

When the "covariate" is categorical (e.g., site, school, gender), it functions as a blocking factor rather than a continuous covariate. This is handled as a two-way ANOVA (main effect of group + main effect of block) rather than ANCOVA.

DataStatPro handles this automatically: selecting a categorical variable as a covariate prompts the user to reclassify it as a blocking factor in a factorial ANOVA design.

5.5 ANCOVA for Pre-Post Designs (Pre-Test as Covariate)

The most common ANCOVA application in clinical and educational research:

This design removes pre-existing individual differences (captured by the pre-test) from the error term, isolating treatment effects on change from baseline while controlling for regression to the mean.

Advantages over gain score analysis:

5.6 Johnson-Neyman ANCOVA (Heterogeneous Slopes)

When the homogeneity of regression slopes assumption is violated (significant group × covariate interaction), Johnson-Neyman analysis identifies the region of the covariate where the group difference is statistically significant and the region where it is not.

The Johnson-Neyman boundary point(s) are the covariate values at which the adjusted group difference transitions from significant to non-significant. Between K=2K = 2 groups:

XJN=Xˉ±tcritSEb1b22Fcrit(Xˉ1Xˉ2)2somethingb1b2X_{JN} = \bar{X} \pm \frac{t_{crit}\sqrt{SE^2_{b_1-b_2} \cdot F_{crit} - (\bar{X}_1 - \bar{X}_2)^2 \cdot \text{something}}}{b_1 - b_2}

DataStatPro computes Johnson-Neyman regions numerically and displays them as a floodlight plot (significance region shaded along the covariate axis).

5.7 Choosing Between Variants

ConditionRecommended Test
Normal, equal slopes, equal variancesStandard ANCOVA
Normal, equal slopes, unequal variancesHeteroscedastic ANCOVA (HC3)
Non-normal, small njn_jQuade test or ranked ANCOVA
Unequal slopes across groupsJohnson-Neyman analysis / moderated regression
Multiple theoretically-motivated covariatesANCOVA with multiple covariates
Pre-post design, same DV measured twiceANCOVA (pre-test as covariate)
Categorical covariateTwo-way ANOVA (blocking factor)

6. Using the ANCOVA Calculator Component

The ANCOVA Calculator in DataStatPro provides a comprehensive tool for running, diagnosing, visualising, and reporting ANCOVA and its alternatives.

Step-by-Step Guide

Step 1 — Select "ANCOVA"

From the "Test Type" dropdown, choose:

Step 2 — Input Method

Choose how to provide the data:

Step 3 — Specify Variables

Step 4 — Select Assumption Checks

DataStatPro automatically runs and displays:

Step 5 — Select Post-Hoc Tests

When the omnibus F is significant, select post-hoc tests on adjusted means:

Step 6 — Select Effect Sizes

Step 7 — Select Display Options

Step 8 — Run the Analysis

Click "Run ANCOVA". DataStatPro will:

  1. Test homogeneity of regression slopes; warn if violated and offer Johnson-Neyman analysis as an alternative.
  2. Compute the full ANCOVA source table (adjusted SS, adjusted MS, F-ratios, p-values).
  3. Run all assumption tests and display colour-coded warnings.
  4. Compute all adjusted group means (yˉj(adj)\bar{y}_{j(adj)}) and their standard errors.
  5. Compute all effect sizes with exact non-central F-based CIs.
  6. Run all selected post-hoc tests on adjusted means with adjusted p-values and individual dadj,jkd_{adj,jk}.
  7. Generate all visualisations.
  8. Auto-generate the APA-compliant results paragraph.

7. Full Step-by-Step Procedure

7.1 Complete Computational Procedure

This section walks through every computational step for ANCOVA, from raw data to a complete APA-style conclusion. A single covariate (p=1p = 1) is assumed.

Given: KK groups, DV yijy_{ij}, covariate xijx_{ij}, i=1,,nji = 1,\ldots,n_j, j=1,,Kj = 1,\ldots,K. Total N=jnjN = \sum_j n_j.


Step 1 — State the Hypotheses

H0:μ1(adj)=μ2(adj)==μK(adj)H_0: \mu_{1(adj)} = \mu_{2(adj)} = \cdots = \mu_{K(adj)}

H1:H_1: At least one adjusted population mean μj(adj)\mu_{j(adj)} differs from the others.

Choose α\alpha (default: .05.05).


Step 2 — Compute Descriptive Statistics per Group

For each group jj, compute for both yijy_{ij} and xijx_{ij}:

yˉj=1nji=1njyij,syj=i=1nj(yijyˉj)2nj1\bar{y}_j = \frac{1}{n_j}\sum_{i=1}^{n_j}y_{ij}, \quad s_{y_j} = \sqrt{\frac{\sum_{i=1}^{n_j}(y_{ij}-\bar{y}_j)^2}{n_j-1}}

xˉj=1nji=1njxij,sxj=i=1nj(xijxˉj)2nj1\bar{x}_j = \frac{1}{n_j}\sum_{i=1}^{n_j}x_{ij}, \quad s_{x_j} = \sqrt{\frac{\sum_{i=1}^{n_j}(x_{ij}-\bar{x}_j)^2}{n_j-1}}

rxyj=i(xijxˉj)(yijyˉj)(nj1)sxjsyjr_{xy_j} = \frac{\sum_i(x_{ij}-\bar{x}_j)(y_{ij}-\bar{y}_j)}{(n_j-1)s_{x_j}s_{y_j}}

Grand means:

yˉ..=jnjyˉjN,xˉ..=jnjxˉjN\bar{y}_{..} = \frac{\sum_j n_j\bar{y}_j}{N}, \quad \bar{x}_{..} = \frac{\sum_j n_j\bar{x}_j}{N}


Step 3 — Check Assumption: Homogeneity of Regression Slopes

Fit the full interaction model:

Yi=μ+τj+βXi+γjXi+εiY_i = \mu + \tau_j + \beta X_i + \gamma_j X_i + \varepsilon_i

Test H0H_0: all γj=0\gamma_j = 0 using the interaction F-test.

If pinteraction<.05p_{interaction} < .05: stop standard ANCOVA; use Johnson-Neyman or moderated regression instead. Report this finding.

If pinteraction.05p_{interaction} \geq .05: proceed with standard ANCOVA.


Step 4 — Compute Within-Group Sums of Squares and Cross-Products

SSYY(W)=j=1K(nj1)syj2SS_{YY(W)} = \sum_{j=1}^K(n_j-1)s_{y_j}^2

SSXX(W)=j=1K(nj1)sxj2SS_{XX(W)} = \sum_{j=1}^K(n_j-1)s_{x_j}^2

SPXY(W)=j=1K(nj1)sxjsyjrxyjSP_{XY(W)} = \sum_{j=1}^K(n_j-1)s_{x_j}s_{y_j}r_{xy_j}


Step 5 — Compute Total Sums of Squares and Cross-Products

SSYY(T)=j=1Ki=1nj(yijyˉ..)2SS_{YY(T)} = \sum_{j=1}^K\sum_{i=1}^{n_j}(y_{ij}-\bar{y}_{..})^2

SSXX(T)=j=1Ki=1nj(xijxˉ..)2SS_{XX(T)} = \sum_{j=1}^K\sum_{i=1}^{n_j}(x_{ij}-\bar{x}_{..})^2

SPXY(T)=j=1Ki=1nj(xijxˉ..)(yijyˉ..)SP_{XY(T)} = \sum_{j=1}^K\sum_{i=1}^{n_j}(x_{ij}-\bar{x}_{..})(y_{ij}-\bar{y}_{..})


Step 6 — Compute Between-Group Sums of Squares and Cross-Products

SSYY(B)=SSYY(T)SSYY(W)SS_{YY(B)} = SS_{YY(T)} - SS_{YY(W)}

SSXX(B)=SSXX(T)SSXX(W)SS_{XX(B)} = SS_{XX(T)} - SS_{XX(W)}

SPXY(B)=SPXY(T)SPXY(W)SP_{XY(B)} = SP_{XY(T)} - SP_{XY(W)}


Step 7 — Compute the Pooled Within-Group Regression Coefficient

β^=SPXY(W)SSXX(W)\hat{\beta} = \frac{SP_{XY(W)}}{SS_{XX(W)}}


Step 8 — Compute Adjusted Sums of Squares

Adjusted within-groups SS (error):

SSwithin(adj)=SSYY(W)SPXY(W)2SSXX(W)=SSYY(W)β^SPXY(W)SS_{within(adj)} = SS_{YY(W)} - \frac{SP_{XY(W)}^2}{SS_{XX(W)}} = SS_{YY(W)} - \hat{\beta} \cdot SP_{XY(W)}

Adjusted total SS:

SStotal(adj)=SSYY(T)SPXY(T)2SSXX(T)SS_{total(adj)} = SS_{YY(T)} - \frac{SP_{XY(T)}^2}{SS_{XX(T)}}

Adjusted between-groups SS:

SSbetween(adj)=SStotal(adj)SSwithin(adj)SS_{between(adj)} = SS_{total(adj)} - SS_{within(adj)}

Covariate SS:

SScovariate=SSYY(W)SSwithin(adj)=β^SPXY(W)SS_{covariate} = SS_{YY(W)} - SS_{within(adj)} = \hat{\beta} \cdot SP_{XY(W)}


Step 9 — Compute Degrees of Freedom

dfbetween=K1df_{between} = K-1

dfcovariate=1df_{covariate} = 1 (for single covariate; pp in general)

dferror=NK1df_{error} = N - K - 1 (for single covariate; NKpN-K-p in general)

dftotal=N2df_{total} = N - 2 (for single covariate; N1pN-1-p in general)


Step 10 — Compute Mean Squares and F-Ratios

MSbetween(adj)=SSbetween(adj)/(K1)MS_{between(adj)} = SS_{between(adj)}/(K-1)

MSerror(adj)=SSwithin(adj)/(NK1)MS_{error(adj)} = SS_{within(adj)}/(N-K-1)

MScovariate=SScovariate/1MS_{covariate} = SS_{covariate}/1

Fgroup=MSbetween(adj)/MSerror(adj)F_{group} = MS_{between(adj)}/MS_{error(adj)} with df=(K1,  NK1)df = (K-1,\;N-K-1)

Fcovariate=MScovariate/MSerror(adj)F_{covariate} = MS_{covariate}/MS_{error(adj)} with df=(1,  NK1)df = (1,\;N-K-1)


Step 11 — Compute Adjusted Group Means

yˉj(adj)=yˉjβ^(xˉjxˉ..)\bar{y}_{j(adj)} = \bar{y}_j - \hat{\beta}(\bar{x}_j - \bar{x}_{..})

SEj(adj)=MSerror(adj)(1nj+(xˉjxˉ..)2SSXX(W))SE_{j(adj)} = \sqrt{MS_{error(adj)}\left(\frac{1}{n_j} + \frac{(\bar{x}_j-\bar{x}_{..})^2}{SS_{XX(W)}}\right)}


Step 12 — Check Remaining Assumptions


Step 13 — Compute Effect Sizes

Partial eta squared:

ηp2=SSbetween(adj)SSbetween(adj)+SSwithin(adj)\eta^2_p = \frac{SS_{between(adj)}}{SS_{between(adj)} + SS_{within(adj)}}

Partial omega squared (bias-corrected, preferred):

ωp2=SSbetween(adj)(K1)MSerror(adj)SSbetween(adj)+SSwithin(adj)+MSerror(adj)\omega^2_p = \frac{SS_{between(adj)} - (K-1)MS_{error(adj)}}{SS_{between(adj)} + SS_{within(adj)} + MS_{error(adj)}}

Partial epsilon squared:

εp2=SSbetween(adj)(K1)MSerror(adj)SSbetween(adj)+SSwithin(adj)\varepsilon^2_p = \frac{SS_{between(adj)} - (K-1)MS_{error(adj)}}{SS_{between(adj)} + SS_{within(adj)}}

Cohen's fpf_p:

fp=ωp21ωp2f_p = \sqrt{\frac{\omega^2_p}{1-\omega^2_p}}


Step 14 — Compute 95% CI for ωp2\omega^2_p

Using the non-central F-distribution with df1=K1df_1 = K-1 and df2=NK1df_2 = N-K-1. DataStatPro performs this computation numerically (see Section 8.5 for details).


Step 15 — Conduct Post-Hoc Tests on Adjusted Means (if F significant)

Select the appropriate post-hoc test (Section 9). Compute pairwise differences of adjusted means, standard errors, adjusted p-values, and individual Cohen's dadj,jkd_{adj,jk} for each pair.


Step 16 — Interpret and Report

Combine all results into an APA-compliant report (Section 13.8).


8. Effect Sizes for ANCOVA

8.1 Partial vs. Total Effect Sizes in ANCOVA

In ANCOVA, effect sizes are partial — they express the proportion of variance explained by group membership after removing the variance explained by the covariate. Partial effect sizes are appropriate because the covariate is not the substantive effect of interest; it is only a control variable.

Important distinction:

8.2 Partial Eta Squared (ηp2\eta^2_p) — Common but Biased

ηp2=SSbetween(adj)SSbetween(adj)+SSwithin(adj)\eta^2_p = \frac{SS_{between(adj)}}{SS_{between(adj)} + SS_{within(adj)}}

ηp2\eta^2_p is the proportion of adjusted DV variance accounted for by group membership. It is the most commonly reported ANCOVA effect size (default in SPSS and most software).

Critical limitation: ηp2\eta^2_p is positively biased, overestimating the true population partial effect, particularly in small samples with many groups.

From F (direct computation):

ηp2=FdfBFdfB+dferror(adj)\eta^2_p = \frac{F \cdot df_B}{F \cdot df_B + df_{error(adj)}}

⚠️ Report ηp2\eta^2_p only when explicitly required by a journal or for historical comparison. Always report ωp2\omega^2_p (or εp2\varepsilon^2_p) as the primary effect size and label ηp2\eta^2_p as "biased" in your manuscript.

8.3 Partial Omega Squared (ωp2\omega^2_p) — Preferred

ωp2=SSbetween(adj)(K1)MSerror(adj)SSbetween(adj)+SSwithin(adj)+MSerror(adj)\omega^2_p = \frac{SS_{between(adj)} - (K-1)MS_{error(adj)}}{SS_{between(adj)} + SS_{within(adj)} + MS_{error(adj)}}

ωp2\omega^2_p is the bias-corrected estimate of the population partial proportion of variance explained. It is the recommended primary effect size for ANCOVA.

Properties:

From F (approximate):

ωp2(F1)(K1)(F1)(K1)+N\omega^2_p \approx \frac{(F-1)(K-1)}{(F-1)(K-1) + N}

8.4 Partial Epsilon Squared (εp2\varepsilon^2_p) — Alternative Correction

εp2=SSbetween(adj)(K1)MSerror(adj)SSbetween(adj)+SSwithin(adj)\varepsilon^2_p = \frac{SS_{between(adj)} - (K-1)MS_{error(adj)}}{SS_{between(adj)} + SS_{within(adj)}}

Properties:

8.5 Cohen's fpf_p — For Power Analysis

fp=ηp21ηp2f_p = \sqrt{\frac{\eta^2_p}{1-\eta^2_p}} or fp=ωp21ωp2f_p = \sqrt{\frac{\omega^2_p}{1-\omega^2_p}}

Cohen's fpf_p is used as the effect size input for ANCOVA power analysis. It represents the ratio of between-groups adjusted SD to within-groups adjusted SD.

Benchmarks: Small = 0.10, Medium = 0.25, Large = 0.40 (Cohen, 1988).

8.6 Cohen's dadjd_{adj} for Pairwise Comparisons

For each pairwise comparison of adjusted means, report Cohen's dadjd_{adj}:

dadj,jk=yˉj(adj)yˉk(adj)MSerror(adj)d_{adj,jk} = \frac{\bar{y}_{j(adj)} - \bar{y}_{k(adj)}}{\sqrt{MS_{error(adj)}}}

Using MSerror(adj)\sqrt{MS_{error(adj)}} as the standardiser is preferred because it is the ANCOVA-based estimate of the common within-group SD after covariate adjustment.

95% CI for the pairwise adjusted mean difference:

(yˉj(adj)yˉk(adj))±tα/2,  NK1×MSerror(adj)(1nj+1nk+(xˉjxˉk)2SSXX(W))(\bar{y}_{j(adj)} - \bar{y}_{k(adj)}) \pm t_{\alpha/2,\;N-K-1} \times \sqrt{MS_{error(adj)}\left(\frac{1}{n_j} + \frac{1}{n_k} + \frac{(\bar{x}_j-\bar{x}_k)^2}{SS_{XX(W)}}\right)}

Note: The CI is wider than in ANOVA because of the additional uncertainty from groups potentially differing on the covariate.

8.7 Variance Explained by the Covariate

The partial η2\eta^2 for the covariate quantifies how much of the adjusted DV variance the covariate explains:

ηp,cov2=SScovariateSScovariate+SSwithin(adj)\eta^2_{p,cov} = \frac{SS_{covariate}}{SS_{covariate} + SS_{within(adj)}}

This is the squared semi-partial correlation between the covariate and DV, partialling the group effect.

Proportion of within-group variance explained (squared pooled within-group correlation):

rXY(W)2=SPXY(W)2SSXX(W)SSYY(W)r^2_{XY(W)} = \frac{SP_{XY(W)}^2}{SS_{XX(W)} \cdot SS_{YY(W)}}

8.8 Comparison of ANOVA vs. ANCOVA Effect Sizes

ANCOVA effect sizes (ωp2\omega^2_p, ηp2\eta^2_p) are generally larger than ANOVA effect sizes (ω2\omega^2, η2\eta^2) on the same data, because the denominator (error variance) is reduced by covariate adjustment. This inflated appearance is appropriate — it reflects the genuine increase in precision from including the covariate. However, it is not valid to compare effect sizes across ANOVA and ANCOVA analyses without acknowledging this difference.

Power improvement from covariate (approximate):

PowerANCOVAPowerANOVA11rXY(W)2(for large N)\frac{\text{Power}_{ANCOVA}}{\text{Power}_{ANOVA}} \approx \sqrt{\frac{1}{1-r^2_{XY(W)}}} \quad \text{(for large }N\text{)}

For rXY(W)=0.70r_{XY(W)} = 0.70 (r2=0.49r^2 = 0.49): Power ratio 1/0.51=1.40\approx \sqrt{1/0.51} = 1.40 — ANCOVA has approximately 40% more power than ANOVA.


9. Post-Hoc Tests and Planned Contrasts

9.1 Post-Hoc Tests in ANCOVA Are Applied to Adjusted Means

The critical distinction between ANOVA and ANCOVA post-hoc testing is that in ANCOVA, all pairwise comparisons are made on the adjusted means (yˉj(adj)\bar{y}_{j(adj)}), not the observed means. Using observed means for post-hoc tests after a significant ANCOVA F-test is incorrect and invalidates the comparison.

Standard errors for pairwise adjusted mean differences include an additional term for covariate mean differences between groups (Section 8.6).

9.2 Tukey HSD on Adjusted Means

Tukey's HSD for ANCOVA balanced designs:

HSDjk=qK,  NK1,  α×MSerror(adj)2(1nj+1nk+(xˉjxˉk)2SSXX(W))\text{HSD}_{jk} = q_{K,\;N-K-1,\;\alpha} \times \sqrt{\frac{MS_{error(adj)}}{2}\left(\frac{1}{n_j} + \frac{1}{n_k} + \frac{(\bar{x}_j-\bar{x}_k)^2}{SS_{XX(W)}}\right)}

The studentised range distribution uses df2=NK1df_2 = N-K-1 (ANCOVA error df) rather than NKN-K (ANOVA error df).

For unequal sample sizes (Tukey-Kramer extension):

HSDjk=qK,  NK1,  α2×MSerror(adj)(1nj+1nk+(xˉjxˉk)2SSXX(W))\text{HSD}_{jk} = \frac{q_{K,\;N-K-1,\;\alpha}}{\sqrt{2}} \times \sqrt{MS_{error(adj)}\left(\frac{1}{n_j} + \frac{1}{n_k} + \frac{(\bar{x}_j-\bar{x}_k)^2}{SS_{XX(W)}}\right)}

Declare groups jj and kk different if $|\bar{y}{j(adj)} - \bar{y}{k(adj)}|

\text{HSD}_{jk}$.

9.3 Games-Howell on Adjusted Means

When Levene's test on adjusted residuals is significant, use Games-Howell with group-specific variance estimates:

tjk=yˉj(adj)yˉk(adj)sj(adj)2/nj+sk(adj)2/nkt_{jk} = \frac{\bar{y}_{j(adj)} - \bar{y}_{k(adj)}}{\sqrt{s^2_{j(adj)}/n_j + s^2_{k(adj)}/n_k}}

with Welch-Satterthwaite df.

9.4 Bonferroni and Holm-Bonferroni on Adjusted Means

Bonferroni: Compare each pairwise adjusted-mean p-value to α=α/m\alpha^* = \alpha/m where m=K(K1)/2m = K(K-1)/2.

Holm-Bonferroni (preferred): Sequential procedure applied to sorted p-values from adjusted mean comparisons. Uniformly more powerful than Bonferroni.

9.5 Dunnett's Test on Adjusted Means

When the primary interest is comparing K1K-1 experimental groups to a single control group, Dunnett's test on adjusted means provides optimal power:

tj,control=yˉj(adj)yˉcontrol(adj)MSerror(adj)(1nj+1ncontrol+(xˉjxˉcontrol)2SSXX(W))t_{j,control} = \frac{\bar{y}_{j(adj)} - \bar{y}_{control(adj)}}{\sqrt{MS_{error(adj)}\left(\frac{1}{n_j} + \frac{1}{n_{control}} + \frac{(\bar{x}_j-\bar{x}_{control})^2}{SS_{XX(W)}}\right)}}

Compared against Dunnett's critical values with dferror=NK1df_{error} = N-K-1.

9.6 Planned Contrasts on Adjusted Means

For pre-planned comparisons, the contrast on adjusted means is:

ψ^adj=j=1Kcjyˉj(adj)\hat{\psi}_{adj} = \sum_{j=1}^K c_j \bar{y}_{j(adj)}

with jcj=0\sum_j c_j = 0.

Contrast SS and F:

SSψ(adj)=ψ^adj2jcj2/nj+β^2jcj2(xˉjxˉ..)2/SSXX(W)SS_{\psi(adj)} = \frac{\hat{\psi}_{adj}^2}{\sum_j c_j^2/n_j + \hat{\beta}^2 \sum_j c_j^2(\bar{x}_j-\bar{x}_{..})^2/SS_{XX(W)}}

Fψ(adj)=SSψ(adj)/MSerror(adj)F_{\psi(adj)} = SS_{\psi(adj)}/MS_{error(adj)} with df=(1,  NK1)df = (1,\;N-K-1)

For orthogonal contrasts on adjusted means, the orthogonality condition is:

j=1Kcjcjnj+β^2jcj(xˉjxˉ..)jcj(xˉjxˉ..)SSXX(W)=0\sum_{j=1}^K \frac{c_j c'_j}{n_j} + \hat{\beta}^2 \frac{\sum_j c_j(\bar{x}_j-\bar{x}_{..}) \cdot \sum_j c'_j(\bar{x}_j-\bar{x}_{..})}{SS_{XX(W)}} = 0

(Slightly different from ANOVA orthogonality due to covariate terms.)

DataStatPro computes these automatically when contrast weights are entered.


10. Confidence Intervals

10.1 95% CI for Each Adjusted Group Mean

The 95% CI for the adjusted population mean μj(adj)\mu_{j(adj)}:

yˉj(adj)±tα/2,  NK1×MSerror(adj)(1nj+(xˉjxˉ..)2SSXX(W))\bar{y}_{j(adj)} \pm t_{\alpha/2,\;N-K-1} \times \sqrt{MS_{error(adj)}\left(\frac{1}{n_j} + \frac{(\bar{x}_j-\bar{x}_{..})^2}{SS_{XX(W)}}\right)}

Note: When xˉj=xˉ..\bar{x}_j = \bar{x}_{..} (group jj has the same covariate mean as the grand mean), the CI simplifies to the ANOVA formula. When groups differ on the covariate, the CI is wider — reflecting additional uncertainty in the adjustment.

10.2 95% CI for Pairwise Adjusted Mean Differences

The 95% CI for μj(adj)μk(adj)\mu_{j(adj)} - \mu_{k(adj)}:

(yˉj(adj)yˉk(adj))±tα/2,  NK1×MSerror(adj)(1nj+1nk+(xˉjxˉk)2SSXX(W))(\bar{y}_{j(adj)}-\bar{y}_{k(adj)}) \pm t_{\alpha/2,\;N-K-1} \times \sqrt{MS_{error(adj)}\left(\frac{1}{n_j} + \frac{1}{n_k} + \frac{(\bar{x}_j-\bar{x}_k)^2}{SS_{XX(W)}}\right)}

Using Tukey-adjusted critical values (simultaneous CIs):

Replace tα/2,  NK1t_{\alpha/2,\;N-K-1} with qK,  NK1,  α/2q_{K,\;N-K-1,\;\alpha}/\sqrt{2}.

10.3 95% CI for the Regression Coefficient β^\hat{\beta}

The CI for the pooled within-group slope:

β^±tα/2,  NK1×MSerror(adj)SSXX(W)\hat{\beta} \pm t_{\alpha/2,\;N-K-1} \times \sqrt{\frac{MS_{error(adj)}}{SS_{XX(W)}}}

10.4 95% CI for ωp2\omega^2_p

Using the non-central F-distribution (computed numerically by DataStatPro).

The non-centrality parameter: λ^=(Fgroup1)×dfB\hat{\lambda} = (F_{group}-1) \times df_B

Find λL\lambda_L, λU\lambda_U such that:

P(FK1,  NK1(λL)Fobs)=0.025P(F_{K-1,\;N-K-1}(\lambda_L) \geq F_{obs}) = 0.025

P(FK1,  NK1(λU)Fobs)=0.025P(F_{K-1,\;N-K-1}(\lambda_U) \leq F_{obs}) = 0.025

Convert to ηp2\eta^2_p: ηp,L2=λL/(λL+N)\eta^2_{p,L} = \lambda_L/(\lambda_L + N); ηp,U2=λU/(λU+N)\eta^2_{p,U} = \lambda_U/(\lambda_U + N).

Then apply bias correction to obtain ωp2\omega^2_p bounds.

10.5 CI Width and the Covariate

The CI for adjusted means is wider than the CI for observed means in ANOVA unless groups have equal covariate means. The additional width from the covariate term:

ΔSEj(adj)2=MSerror(adj)(xˉjxˉ..)2SSXX(W)\Delta SE_{j(adj)}^2 = \frac{MS_{error(adj)} \cdot (\bar{x}_j - \bar{x}_{..})^2}{SS_{XX(W)}}

This additional uncertainty vanishes in randomised experiments where random assignment ensures xˉjxˉ..\bar{x}_j \approx \bar{x}_{..} on average. In observational studies, large covariate mean differences between groups produce substantially wider CIs for adjusted means.


11. Power Analysis and Sample Size Planning

11.1 Power Advantage of ANCOVA over ANOVA

The power advantage of ANCOVA over one-way ANOVA depends on the within-group correlation between the covariate and DV:

Effective sample size multiplier:

Neff=N1rXY(W)2N_{eff} = \frac{N}{1 - r^2_{XY(W)}}

ANCOVA with NN participants has equivalent power to ANOVA with NeffN_{eff} participants. For rXY(W)=0.60r_{XY(W)} = 0.60: Neff=N/0.64=1.56NN_{eff} = N/0.64 = 1.56N — ANCOVA with 100 participants has the same power as ANOVA with 156 participants.

However, ANCOVA costs one dferrordf_{error} per covariate, slightly reducing this gain. The net effect on power:

Power gain1rXY(W)2(NK)1(NK1)1rXY(W)2NKNK1\text{Power gain} \approx \frac{\sqrt{1-r^2_{XY(W)}} \cdot (N-K)}{\sqrt{1} \cdot (N-K-1)} \approx \sqrt{1-r^2_{XY(W)}} \cdot \frac{N-K}{N-K-1}

For any rXY(W)>rbreakeven=1/(NK)|r_{XY(W)}| > r_{break-even} = \sqrt{1/(N-K)}, ANCOVA is more powerful.

11.2 A Priori Power Analysis for ANCOVA

Non-centrality parameter for ANCOVA:

λ=fp2N1=fp2N\lambda = \frac{f^2_p \cdot N}{1} = f^2_p \cdot N

Where fp2=ωp2/(1ωp2)f^2_p = \omega^2_p/(1-\omega^2_p) is computed from the partial effect size.

Power computation (exact, using non-central F):

Power=P ⁣(FK1,  K(n1)1(λ)>Fcrit)\text{Power} = P\!\left(F_{K-1,\;K(n-1)-1}(\lambda) > F_{crit}\right)

Where Fcrit=Fα,  K1,  K(n1)1F_{crit} = F_{\alpha,\;K-1,\;K(n-1)-1} and λ=fp2×Kn\lambda = f^2_p \times Kn.

Note: The critical F uses dferror=NK1df_{error} = N-K-1 (ANCOVA df), not NKN-K (ANOVA df).

11.3 Required Sample Size

For ANCOVA power analysis, specify:

  1. Expected ωp2\omega^2_p (or Cohen's fpf_p) for the group effect on adjusted means.
  2. Expected within-group correlation rXY(W)r_{XY(W)} between covariate and DV.
  3. Number of groups KK.
  4. Number of covariates pp.
  5. Desired power (1β1-\beta; typically 0.80 or 0.90).
  6. Significance level α\alpha (typically .05).

Required nn per group for 80% power (α=.05\alpha = .05, one covariate):

fpf_pωp2\omega^2_prXY(W)r_{XY(W)}K=3K=3K=4K=4K=5K=5
0.100.0100.30315268236
0.100.0100.60211180159
0.250.0590.30504338
0.250.0590.60342926
0.400.1380.30201715
0.400.1380.60131210
0.500.2000.5011109
0.600.2650.50876

All values are nn per group. Total N=n×KN = n \times K. Higher rXY(W)r_{XY(W)} requires fewer participants because the covariate removes more error variance.

11.4 Determining Effect Size Inputs

From prior ANOVA literature (convert ANOVA ω2\omega^2 to ANCOVA ωp2\omega^2_p):

If a prior ANOVA found ωANOVA2\omega^2_{ANOVA} and you plan to add a covariate with expected rXY(W)2r^2_{XY(W)}:

ωp2ωANOVA21rXY(W)2\omega^2_p \approx \frac{\omega^2_{ANOVA}}{1 - r^2_{XY(W)}} (approximate)

Because the covariate removes within-group variance from the denominator, the partial effect size is amplified.

From pilot data: Run ANCOVA on the pilot sample and use the observed ωp2\omega^2_p (with appropriate shrinkage, as pilot estimates are noisy).

From theory: Specify minimum practically meaningful differences between adjusted means and estimate σadj=MSerror(adj)σ1rXY(W)2\sigma_{adj} = \sqrt{MS_{error(adj)}} \approx \sigma\sqrt{1-r^2_{XY(W)}}.

11.5 Sensitivity Analysis for ANCOVA

The minimum detectable partial fpf_p for a given NN, KK, pp, and 80% power:

fp,min7.849Npf_{p,min} \approx \sqrt{\frac{7.849}{N - p}} (single covariate; approximate)

For N=90N = 90, K=3K = 3, p=1p = 1: fp,min7.849/89=0.297f_{p,min} \approx \sqrt{7.849/89} = 0.297

Corresponding ωp,min20.081\omega^2_{p,min} \approx 0.081.

⚠️ Report sensitivity analysis for null ANCOVA results. The additional covariate df reduces minimum detectable effects compared to ANOVA — ANCOVA needs to be powered for the partial effect size, which may be larger than the corresponding ANOVA effect.


12. Non-Parametric Alternative: Quade and Ranked ANCOVA

12.1 When to Use Non-Parametric ANCOVA Alternatives

The Quade test and ranked ANCOVA are appropriate when:

12.2 The Quade Test

The Quade test (Quade, 1967) is a non-parametric extension of ANCOVA for ranked data with a single covariate.

Procedure:

Step 1 — Rank the covariate: Rank all NN covariate scores from 1 to NN. Assign average ranks for ties.

Step 2 — Rank the DV within blocks: Using the ranked covariate to define blocks (sort participants by covariate rank and divide into bb blocks of approximately equal size), rank the DV scores within each block from 1 to KK.

Step 3 — Compute residuals within blocks: For each participant, compute the deviation of their DV rank from the expected rank under H0H_0 within their block.

Step 4 — Compute the Quade F-statistic:

FQ=(N1)BABF_Q = \frac{(N-1)B}{A - B}

Where:

B=1b(b1)[j=1KTj2(j=1KTj)2K]B = \frac{1}{b(b-1)}\left[\sum_{j=1}^K T_j^2 - \frac{(\sum_{j=1}^K T_j)^2}{K}\right]

A=1b1j=1Ki=1bSij2A = \frac{1}{b-1}\sum_{j=1}^K\sum_{i=1}^{b}S_{ij}^2

and Tj=iQiRijT_j = \sum_i Q_i R_{ij} (weighted rank sums; QiQ_i = block weight proportional to block range; RijR_{ij} = rank of group jj in block ii).

Step 5 — p-value:

FQFK1,  (K1)(b1)F_Q \sim F_{K-1,\;(K-1)(b-1)} approximately for large NN.

Effect size:

ηQ2=BA/(K1)\eta^2_Q = \frac{B}{A/(K-1)} (analogous to ηH2\eta^2_H for Kruskal-Wallis)

12.3 Ranked ANCOVA (General Approach)

A more flexible non-parametric alternative is to:

  1. Rank both the DV and the covariate (Conover & Iman, 1982).
  2. Run standard ANCOVA on the ranks using the ranked covariate as the covariate and the ranked DV as the dependent variable.
  3. The resulting F-test is approximately distribution-free for large samples.

This approach is simpler to implement, available in DataStatPro, and handles multiple covariates naturally.

Advantages over Quade test:

Limitations:

12.4 Post-Hoc Tests for Quade and Ranked ANCOVA

After a significant Quade test, use Dunn-type pairwise comparisons on the rank residuals with Holm-Bonferroni correction. DataStatPro computes these automatically.

After a significant ranked ANCOVA, apply standard ANCOVA post-hoc tests to the ranked adjusted means with appropriate corrections.

12.5 Efficiency of Non-Parametric ANCOVA

For normal data, ranked ANCOVA has ARE 3/π0.955\approx 3/\pi \approx 0.955 relative to standard ANCOVA — negligible loss. For non-normal data (especially heavy-tailed or skewed distributions), ranked ANCOVA can be substantially more powerful.


13. Advanced Topics

13.1 ANCOVA as a Special Case of the General Linear Model

ANCOVA is a restricted version of the GLM:

Y=Xβ+ε\mathbf{Y} = \mathbf{X}\boldsymbol{\beta} + \boldsymbol{\varepsilon}

Where X\mathbf{X} is the design matrix containing group indicator columns (effect-coded or dummy-coded) and the covariate column(s). In matrix form:

β^=(XX)1XY\hat{\boldsymbol{\beta}} = (\mathbf{X}'\mathbf{X})^{-1}\mathbf{X}'\mathbf{Y}

SSbetween(adj)=β^τXτMcovXτβ^τSS_{between(adj)} = \hat{\boldsymbol{\beta}}_\tau' \mathbf{X}_\tau' \mathbf{M}_{cov} \mathbf{X}_\tau \hat{\boldsymbol{\beta}}_\tau

Where Mcov\mathbf{M}_{cov} is the residual maker matrix after partialling the covariate.

This GLM framework naturally handles:

13.2 Type I, II, and III Sums of Squares in ANCOVA

For balanced designs, Types I, II, and III SS give identical results. For unbalanced designs, they differ:

⚠️ Always report which type of SS was used. Most statistical software defaults to Type III; SPSS, R (car package), and DataStatPro all use Type III by default. Using Type I SS in unbalanced ANCOVA designs leads to incorrect group effect tests.

13.3 Johnson-Neyman Analysis for Heterogeneous Slopes

When the homogeneity of regression slopes assumption is violated, Johnson-Neyman (J-N) analysis identifies the specific values of the covariate XX at which the group difference in YY transitions between statistically significant and non-significant.

For K=2K = 2 groups with slopes β^1\hat{\beta}_1 and β^2\hat{\beta}_2:

The adjusted mean difference as a function of XX is:

ΔY^(X)=(yˉ1(adj)yˉ2(adj))+(β^1β^2)(XXˉ)\Delta\hat{Y}(X) = (\bar{y}_{1(adj)} - \bar{y}_{2(adj)}) + (\hat{\beta}_1 - \hat{\beta}_2)(X - \bar{X})

The J-N boundary XJNX_{JN} is where t(XJN)=tcrit,  α/2|t(X_{JN})| = t_{crit,\;\alpha/2}:

XJN=Xˉ+(yˉ1yˉ2)±tcrittcrit2V22V11+2(yˉ1yˉ2)tcritV12(β^1β^2)2tcrit2V33X_{JN} = \bar{X} + \frac{(\bar{y}_1 - \bar{y}_2) \pm t_{crit}\sqrt{t^2_{crit}V_{22} - V_{11} + 2(\bar{y}_1-\bar{y}_2)t_{crit}V_{12}}}{(\hat{\beta}_1-\hat{\beta}_2)^2 - t^2_{crit}V_{33}}

(Where VijV_{ij} are variance-covariance terms from the heterogeneous ANCOVA model.)

DataStatPro computes J-N regions numerically and displays:

13.4 ANCOVA with Multiple Covariates: Stepwise vs. Simultaneous Entry

When multiple covariates are available:

Simultaneous entry (recommended): All pp theoretically-motivated covariates are entered together in a single ANCOVA model. This is appropriate when all covariates are chosen based on theory before data collection.

Hierarchical entry: Covariates are entered in theoretically-motivated blocks (e.g., demographic covariates first, then psychological covariates). Tests whether each block explains incremental variance after prior blocks.

Stepwise entry (not recommended): Automated variable selection based on statistical criteria (e.g., forward, backward, stepwise). This inflates Type I error, produces unstable models, and overfits the sample. DataStatPro does not support stepwise ANCOVA but supports hierarchical block entry.

13.5 Lord's Paradox

Lord's Paradox (Lord, 1967) is a famous conceptual puzzle arising in pre-post ANCOVA designs. It demonstrates that two different but seemingly valid analyses can produce contradictory conclusions:

Resolution: The two analyses answer different questions:

In randomised experiments with equal pre-test means, both analyses give equivalent results. In observational studies with pre-existing group differences, the two analyses address fundamentally different causal questions. Use directed acyclic graphs (DAGs) to determine which question is scientifically appropriate.

13.6 ANCOVA in Randomised vs. Observational Studies

FeatureRandomised ExperimentObservational Study
Purpose of covariateIncrease powerStatistical control for confounding
Covariate-group independenceGuaranteed by randomisationViolated by design
Interpretation of adjusted meansInterpretable causal effectConditional association; residual confounding possible
Measurement error consequencesMinor power reductionSystematic bias (under-adjustment)
Homogeneity of slopes importanceStandard checkCritical; more likely to be violated
Validity of causal inferenceStrong (covariate adds precision)Weak without strong assumptions

13.7 ANCOVA for Factorial Designs (Factorial ANCOVA)

When there are two or more IVs and one or more covariates, Factorial ANCOVA (also called Two-Way ANCOVA) extends the model:

Yi=μ+αj+βk+(αβ)jk+γ(XiXˉ)+εiY_i = \mu + \alpha_j + \beta_k + (\alpha\beta)_{jk} + \gamma(X_i - \bar{X}) + \varepsilon_i

Where αj\alpha_j = effect of IV1_1 level jj, βk\beta_k = effect of IV2_2 level kk, (αβ)jk(\alpha\beta)_{jk} = interaction, and γ\gamma = covariate slope.

The homogeneity of regression slopes assumption requires the covariate slope to be homogeneous across all j×kj \times k cells, not just across levels of one IV.

DataStatPro handles factorial ANCOVA within its GLM engine; see the Factorial ANOVA tutorial for the base factorial framework.

13.8 Bayesian ANCOVA

Bayesian ANCOVA computes Bayes Factors comparing models that do and do not include the group effect, while including the covariate in both models:

BF10=P(datagroup effect + covariate)P(datacovariate only)BF_{10} = \frac{P(\text{data} \mid \text{group effect + covariate})}{P(\text{data} \mid \text{covariate only})}

This tests whether there is evidence for group differences beyond what the covariate explains. DataStatPro implements Bayesian ANCOVA using the BayesFactor method (Rouder et al., 2012) with Cauchy priors on standardised group effects (r=2/2r = \sqrt{2}/2).

Reporting: "A Bayesian ANCOVA (Cauchy prior, r = \sqrt{2}/2}) with [covariate name] as covariate provided [strong/moderate/anecdotal] evidence for [the group effect / the null hypothesis] after covariate adjustment, BF10=BF_{10} = [value]."

13.9 Reporting ANCOVA According to APA 7th Edition

Full minimum reporting set (APA 7th ed.):

  1. Statement of which test (standard ANCOVA or heteroscedastic), the covariate(s), and the rationale for including each covariate.
  2. Homogeneity of regression slopes test result.
  3. Levene's test result on adjusted residuals.
  4. Covariate FF-test, β\beta coefficient, and partial η2\eta^2 for the covariate.
  5. Group F(dfB,dferror)=F(df_B, df_{error}) = [value], p=p = [value].
  6. ωp2=\omega^2_p = [value] [95% CI: LB, UB].
  7. Which effect size was computed (ωp2\omega^2_p not just "partial effect size").
  8. Both unadjusted AND adjusted group means, SDs, and SEs for all KK groups.
  9. Post-hoc test results on adjusted means with adjusted p-values and dadj,jkd_{adj,jk} per pair.
  10. 95% CI for each significant pairwise adjusted mean difference.

14. Worked Examples

Example 1: Pre-Post ANCOVA — Therapy Type on Depression

A clinical researcher randomly assigns N=90N = 90 participants to three therapy conditions: CBT (n1=30n_1 = 30), Behavioural Activation (BA; n2=30n_2 = 30), and Waitlist Control (WL; n3=30n_3 = 30). Pre-treatment PHQ-9 scores are recorded as the covariate; post- treatment PHQ-9 scores are the DV.

Descriptive statistics:

Groupnjn_jxˉj\bar{x}_j (pre)sxjs_{x_j}yˉj\bar{y}_j (post)syjs_{y_j}rxyjr_{xy_j}
CBT3018.203.809.804.200.720.72
BA3017.904.1011.404.600.680.68
WL3018.403.9016.305.100.610.61

Grand means: xˉ..=(30×18.20+30×17.90+30×18.40)/90=18.167\bar{x}_{..} = (30\times18.20 + 30\times17.90 + 30\times18.40)/90 = 18.167

yˉ..=(30×9.80+30×11.40+30×16.30)/90=12.500\bar{y}_{..} = (30\times9.80 + 30\times11.40 + 30\times16.30)/90 = 12.500

Homogeneity of regression slopes test:

Testing group × covariate interaction: F(2,84)=0.47F(2, 84) = 0.47, p=.626p = .626 — slopes are homogeneous. Proceed with standard ANCOVA.

Within-group SS and cross-products:

SSXX(W)=29(3.802)+29(4.102)+29(3.902)SS_{XX(W)} = 29(3.80^2) + 29(4.10^2) + 29(3.90^2)

=29(14.44)+29(16.81)+29(15.21)=418.76+487.49+441.09=1347.34= 29(14.44) + 29(16.81) + 29(15.21) = 418.76 + 487.49 + 441.09 = 1347.34

SPXY(W)=29(3.80)(4.20)(0.72)+29(4.10)(4.60)(0.68)+29(3.90)(5.10)(0.61)SP_{XY(W)} = 29(3.80)(4.20)(0.72) + 29(4.10)(4.60)(0.68) + 29(3.90)(5.10)(0.61)

=29(11.491)+29(12.835)+29(12.143)=333.24+372.22+352.15=1057.61= 29(11.491) + 29(12.835) + 29(12.143) = 333.24 + 372.22 + 352.15 = 1057.61

SSYY(W)=29(4.202)+29(4.602)+29(5.102)SS_{YY(W)} = 29(4.20^2) + 29(4.60^2) + 29(5.10^2)

=29(17.64)+29(21.16)+29(26.01)=511.56+613.64+754.29=1879.49= 29(17.64) + 29(21.16) + 29(26.01) = 511.56 + 613.64 + 754.29 = 1879.49

Pooled within-group regression coefficient:

β^=1057.61/1347.34=0.7849\hat{\beta} = 1057.61/1347.34 = 0.7849

Adjusted within-groups SS:

SSwithin(adj)=1879.49(1057.61)2/1347.34=1879.49830.46=1049.03SS_{within(adj)} = 1879.49 - (1057.61)^2/1347.34 = 1879.49 - 830.46 = 1049.03

Total SS and cross-products:

SSYY(T)=(yijyˉ..)2=2567.69SS_{YY(T)} = \sum(y_{ij}-\bar{y}_{..})^2 = 2567.69 (computed from raw data)

SSXX(T)=(xijxˉ..)2=1372.17SS_{XX(T)} = \sum(x_{ij}-\bar{x}_{..})^2 = 1372.17

SPXY(T)=(xijxˉ..)(yijyˉ..)=1068.43SP_{XY(T)} = \sum(x_{ij}-\bar{x}_{..})(y_{ij}-\bar{y}_{..}) = 1068.43

Adjusted total SS:

SStotal(adj)=2567.69(1068.43)2/1372.17=2567.69831.39=1736.30SS_{total(adj)} = 2567.69 - (1068.43)^2/1372.17 = 2567.69 - 831.39 = 1736.30

Adjusted between-groups SS:

SSbetween(adj)=1736.301049.03=687.27SS_{between(adj)} = 1736.30 - 1049.03 = 687.27

Covariate SS:

SScovariate=(1057.61)2/1347.34=830.46SS_{covariate} = (1057.61)^2/1347.34 = 830.46

Degrees of freedom:

dfbetween=2df_{between} = 2; dfcovariate=1df_{covariate} = 1; dferror=9031=86df_{error} = 90-3-1 = 86

Mean squares and F-ratios:

MSbetween(adj)=687.27/2=343.64MS_{between(adj)} = 687.27/2 = 343.64

MSerror(adj)=1049.03/86=12.198MS_{error(adj)} = 1049.03/86 = 12.198

MScovariate=830.46/1=830.46MS_{covariate} = 830.46/1 = 830.46

Fgroup=343.64/12.198=28.17F_{group} = 343.64/12.198 = 28.17, p<.001p < .001

Fcovariate=830.46/12.198=68.08F_{covariate} = 830.46/12.198 = 68.08, p<.001p < .001

ANCOVA source table:

SourceSSdfdfMSFFpp
Covariate (Pre-PHQ-9)830.46830.4611830.46830.4668.0868.08<.001< .001
Group (Therapy)687.27687.2722343.64343.6428.1728.17<.001< .001
Error1049.031049.03868612.19812.198
Total (adjusted)1736.301736.308989

Adjusted group means:

yˉ1(adj)=9.800.7849(18.2018.167)=9.800.026=9.774\bar{y}_{1(adj)} = 9.80 - 0.7849(18.20-18.167) = 9.80 - 0.026 = 9.774

yˉ2(adj)=11.400.7849(17.9018.167)=11.40+0.210=11.610\bar{y}_{2(adj)} = 11.40 - 0.7849(17.90-18.167) = 11.40 + 0.210 = 11.610

yˉ3(adj)=16.300.7849(18.4018.167)=16.300.183=16.117\bar{y}_{3(adj)} = 16.30 - 0.7849(18.40-18.167) = 16.30 - 0.183 = 16.117

Standard errors of adjusted means:

SEj(adj)=12.198(130+(xˉj18.167)21347.34)SE_{j(adj)} = \sqrt{12.198\left(\frac{1}{30} + \frac{(\bar{x}_j-18.167)^2}{1347.34}\right)}

CBT: SE1(adj)=12.198(0.0333+0.0000)=0.406=0.637SE_{1(adj)} = \sqrt{12.198(0.0333+0.0000)} = \sqrt{0.406} = 0.637

BA: SE2(adj)=12.198(0.0333+0.0000)0.637SE_{2(adj)} = \sqrt{12.198(0.0333+0.0000)} \approx 0.637

WL: SE3(adj)=12.198(0.0333+0.0000)0.637SE_{3(adj)} = \sqrt{12.198(0.0333+0.0000)} \approx 0.637

(Adjustments are minimal here because pre-test means are nearly equal — expected in a randomised design.)

Effect sizes:

ηp2=687.27/(687.27+1049.03)=687.27/1736.30=0.396\eta^2_p = 687.27/(687.27+1049.03) = 687.27/1736.30 = 0.396

ωp2=(687.272×12.198)/(1736.30+12.198)=662.87/1748.50=0.379\omega^2_p = (687.27 - 2\times12.198)/(1736.30+12.198) = 662.87/1748.50 = 0.379

εp2=(687.272×12.198)/1736.30=662.87/1736.30=0.382\varepsilon^2_p = (687.27 - 2\times12.198)/1736.30 = 662.87/1736.30 = 0.382

fp=0.379/0.621=0.610=0.781f_p = \sqrt{0.379/0.621} = \sqrt{0.610} = 0.781

95% CI for ωp2\omega^2_p (non-central F, Fobs=28.17F_{obs}=28.17, df1=2df_1=2, df2=86df_2=86):

λ^=(28.171)×2=54.34\hat{\lambda} = (28.17-1)\times2 = 54.34

95% CI for λ\lambda: [31.48,83.20][31.48, 83.20] (DataStatPro numerical)

ωp,L2=0.261\omega^2_{p,L} = 0.261; ωp,U2=0.482\omega^2_{p,U} = 0.482

Comparison with one-way ANOVA (without covariate):

From the One-Way ANOVA tutorial, the same data gave F(2,87)=15.96F(2,87)=15.96, ω2=0.249\omega^2=0.249.

ANCOVA gives F(2,86)=28.17F(2,86)=28.17, ωp2=0.379\omega^2_p=0.379 — the pre-test covariate (rXY(W)0.67r_{XY(W)} \approx 0.67 pooled) substantially increased power and effect size.

Post-hoc tests (Tukey HSD on adjusted means):

q3,  86,  .05=3.369q_{3,\;86,\;.05} = 3.369

HSDjk=3.369×12.198(1/30+1/30+(xˉjxˉk)2/1347.34)/2\text{HSD}_{jk} = 3.369 \times \sqrt{12.198(1/30+1/30+(\bar{x}_j-\bar{x}_k)^2/1347.34)/2}

For CBT vs. BA: xˉ1xˉ2=0.30\bar{x}_1-\bar{x}_2 = 0.30, HSD123.369×0.641=2.160\text{HSD}_{12} \approx 3.369 \times 0.641 = 2.160

ComparisonAdj. DiffSEadjSE_{adj}qqpadjp_{adj}dadj,jkd_{adj,jk}95% CI
CBT vs. BA1.8361.8360.6410.6412.8642.864.136.1360.5260.526[0.32,3.99][-0.32, 3.99]
CBT vs. WL6.3436.3430.6410.6419.8969.896<.001< .0011.8151.815[4.18,8.50][4.18, 8.50]
BA vs. WL4.5074.5070.6410.6417.0317.031<.001< .0011.2901.290[2.35,6.67][2.35, 6.67]

Where dadj,jk=yˉj(adj)yˉk(adj)/12.198=/3.493d_{adj,jk} = |\bar{y}_{j(adj)}-\bar{y}_{k(adj)}|/\sqrt{12.198} = |\cdot|/3.493

Assumption checks:

Shapiro-Wilk (adjusted residuals): W=0.981W = 0.981, p=.259p = .259 — normality not violated.

Levene's test (adjusted residuals): F(2,87)=0.71F(2,87) = 0.71, p=.494p = .494 — homoscedasticity holds.

Covariate balance: F(2,87)=0.14F(2,87) = 0.14, p=.872p = .872 — groups do not differ on pre-PHQ-9 (expected from randomisation). ✅

APA write-up: "A one-way ANCOVA was conducted with therapy type (CBT, BA, Waitlist Control) as the independent variable, post-treatment PHQ-9 as the dependent variable, and pre-treatment PHQ-9 as the covariate. The homogeneity of regression slopes assumption was met (F(2,84)=0.47F(2, 84) = 0.47, p=.626p = .626), and Levene's test indicated equal variances across groups on the adjusted residuals (F(2,87)=0.71F(2, 87) = 0.71, p=.494p = .494). The covariate (pre-treatment PHQ-9) was significantly related to the outcome after controlling for therapy type, F(1,86)=68.08F(1, 86) = 68.08, p<.001p < .001, ηp2=.442\eta^2_p = .442. After controlling for pre-treatment depression, there was a significant effect of therapy type on post-treatment PHQ-9, F(2,86)=28.17F(2, 86) = 28.17, p<.001p < .001, ωp2=0.379\omega^2_p = 0.379 [95% CI: 0.261, 0.482], indicating a large effect. Adjusted post-treatment means were: CBT (Madj=9.77M_{adj} = 9.77, SE=0.64SE = 0.64), BA (Madj=11.61M_{adj} = 11.61, SE=0.64SE = 0.64), and Waitlist Control (Madj=16.12M_{adj} = 16.12, SE=0.64SE = 0.64). Tukey HSD post-hoc comparisons on adjusted means revealed that both CBT and BA produced significantly lower adjusted post-treatment scores than the Waitlist Control (both p<.001p < .001), with large effects (dCBTWL=1.82d_{CBT-WL} = 1.82 [95% CI: 1.19, 2.44]; dBAWL=1.29d_{BA-WL} = 1.29 [95% CI: 0.67, 1.90]). CBT and BA did not differ significantly, d=0.53d = 0.53 [95% CI: -0.09, 1.15], p=.136p = .136."


Example 2: Observational ANCOVA — Teaching Methods with SES Covariate

An educational researcher compares three teaching methods (Lecture, Flipped, Project-based) on standardised test scores in a non-randomised study. Socioeconomic Status (SES) index (0–100) is included as a covariate because it is known to correlate with academic outcomes and groups were self-selected into schools with different SES distributions.

nj=35n_j = 35 per group; N=105N = 105; K=3K = 3.

Descriptive statistics:

Groupnjn_jxˉj\bar{x}_j (SES)sxjs_{x_j}yˉj\bar{y}_j (score)syjs_{y_j}rxyjr_{xy_j}
Lecture3542.8012.4064.209.800.530.53
Flipped3558.6011.9072.4010.200.570.57
Project3571.3010.8078.1011.400.490.49

xˉ..=(35×42.80+35×58.60+35×71.30)/105=57.567\bar{x}_{..} = (35\times42.80+35\times58.60+35\times71.30)/105 = 57.567

Covariate balance test:

ANOVA with SES as DV: F(2,102)=23.84F(2,102) = 23.84, p<.001p < .001 — groups differ significantly on SES. This is expected in an observational design. ANCOVA will adjust for these pre-existing SES differences.

Homogeneity of regression slopes: F(2,99)=1.18F(2, 99) = 1.18, p=.311p = .311 — slopes are homogeneous. Standard ANCOVA is appropriate.

Pooled within-group sums:

SSXX(W)=34(12.402)+34(11.902)+34(10.802)SS_{XX(W)} = 34(12.40^2)+34(11.90^2)+34(10.80^2)

=34(153.76)+34(141.61)+34(116.64)=5227.84+4814.74+3965.76=14008.34= 34(153.76)+34(141.61)+34(116.64) = 5227.84+4814.74+3965.76 = 14008.34

SPXY(W)=34(12.40)(9.80)(0.53)+34(11.90)(10.20)(0.57)+34(10.80)(11.40)(0.49)SP_{XY(W)} = 34(12.40)(9.80)(0.53)+34(11.90)(10.20)(0.57)+34(10.80)(11.40)(0.49)

=34(64.426)+34(69.177)+34(60.328)=2190.48+2352.02+2051.15=6593.65= 34(64.426)+34(69.177)+34(60.328) = 2190.48+2352.02+2051.15 = 6593.65

SSYY(W)=34(9.802)+34(10.202)+34(11.402)SS_{YY(W)} = 34(9.80^2)+34(10.20^2)+34(11.40^2)

=34(96.04)+34(104.04)+34(129.96)=3265.36+3537.36+4418.64=11221.36= 34(96.04)+34(104.04)+34(129.96) = 3265.36+3537.36+4418.64 = 11221.36

β^=6593.65/14008.34=0.4707\hat{\beta} = 6593.65/14008.34 = 0.4707

SSwithin(adj)=11221.36(6593.65)2/14008.34=11221.363103.24=8118.12SS_{within(adj)} = 11221.36 - (6593.65)^2/14008.34 = 11221.36 - 3103.24 = 8118.12

Unadjusted between-groups SS: SSYY(T)=12846.91SS_{YY(T)} = 12846.91; SSbetween=12846.9111221.36=1625.55SS_{between} = 12846.91-11221.36 = 1625.55

Total adjusted SS (computed from full data): SStotal(adj)=9204.87SS_{total(adj)} = 9204.87

SSbetween(adj)=9204.878118.12=1086.75SS_{between(adj)} = 9204.87 - 8118.12 = 1086.75

dferror=10531=101df_{error} = 105-3-1 = 101; dfB=2df_B = 2

MSbetween(adj)=1086.75/2=543.38MS_{between(adj)} = 1086.75/2 = 543.38

MSerror(adj)=8118.12/101=80.377MS_{error(adj)} = 8118.12/101 = 80.377

Fgroup=543.38/80.377=6.76F_{group} = 543.38/80.377 = 6.76, p=.002p = .002

Compare with unadjusted ANOVA:

MSbetween=1625.55/2=812.78MS_{between} = 1625.55/2 = 812.78; MSwithin=11221.36/102=110.013MS_{within} = 11221.36/102 = 110.013; FANOVA=7.39F_{ANOVA} = 7.39, p=.001p = .001

Note: Here the unadjusted F is slightly larger because the observed group differences on the DV are partly inflated by SES differences. ANCOVA removes the SES contribution, giving a more accurate (though still significant) test.

Adjusted group means:

yˉ1(adj)=64.200.4707(42.8057.567)=64.20+6.947=71.147\bar{y}_{1(adj)} = 64.20 - 0.4707(42.80-57.567) = 64.20 + 6.947 = 71.147

yˉ2(adj)=72.400.4707(58.6057.567)=72.400.486=71.914\bar{y}_{2(adj)} = 72.40 - 0.4707(58.60-57.567) = 72.40 - 0.486 = 71.914

yˉ3(adj)=78.100.4707(71.3057.567)=78.106.462=71.638\bar{y}_{3(adj)} = 78.10 - 0.4707(71.30-57.567) = 78.10 - 6.462 = 71.638

Effect sizes:

ηp2=1086.75/(1086.75+8118.12)=0.118\eta^2_p = 1086.75/(1086.75+8118.12) = 0.118

ωp2=(1086.752×80.377)/(1086.75+8118.12+80.377)=925.996/9285.247=0.100\omega^2_p = (1086.75-2\times80.377)/(1086.75+8118.12+80.377) = 925.996/9285.247 = 0.100

fp=0.100/0.900=0.333f_p = \sqrt{0.100/0.900} = 0.333

Post-hoc tests (Tukey HSD on adjusted means):

With adjusted means of 71.15, 71.91, and 71.64 — these are very close.

ComparisonAdj. Diffpadjp_{adj}dadj,jkd_{adj,jk}95% CI
Lecture vs. Flipped0.7670.767.898.8980.0860.086[3.42,4.95][-3.42, 4.95]
Lecture vs. Project0.4910.491.960.9600.0550.055[3.69,4.67][-3.69, 4.67]
Flipped vs. Project0.2760.276.989.9890.0310.031[3.90,4.46][-3.90, 4.46]

After controlling for SES, none of the pairwise adjusted mean differences are statistically significant. The apparent differences in observed means were largely due to pre-existing SES differences between the self-selected school groups.

APA write-up: "A one-way ANCOVA was conducted to examine the effect of teaching method (Lecture, Flipped, Project-based) on standardised test scores, with SES index as the covariate to control for pre-existing socioeconomic differences between schools. As expected in this non-randomised design, groups differed significantly on the covariate (F(2,102)=23.84F(2, 102) = 23.84, p<.001p < .001). The homogeneity of regression slopes assumption was satisfied (F(2,99)=1.18F(2, 99) = 1.18, p=.311p = .311). The covariate was significantly related to test scores, F(1,101)=38.61F(1, 101) = 38.61, p<.001p < .001, ηp2=.277\eta^2_p = .277. After controlling for SES, there was a statistically significant effect of teaching method, F(2,101)=6.76F(2, 101) = 6.76, p=.002p = .002, ωp2=0.100\omega^2_p = 0.100 [95% CI: 0.022, 0.196], indicating a medium effect. However, Tukey HSD post-hoc comparisons on the SES-adjusted means revealed no significant pairwise differences between any teaching method pair (all p>.89p > .89, dadjd_{adj} range: 0.03–0.09). The adjusted means were nearly identical across methods (Lecture: Madj=71.15M_{adj} = 71.15; Flipped: Madj=71.91M_{adj} = 71.91; Project: Madj=71.64M_{adj} = 71.64). These findings indicate that the observed differences in unadjusted test scores were largely attributable to SES differences between schools rather than to teaching method differences per se."


Example 3: Violated Homogeneity of Slopes — Johnson-Neyman Analysis

A researcher examines the effect of three exercise programmes (Aerobic, Resistance, Combined) on depression scores, using baseline fitness level as a covariate.

nj=25n_j = 25 per group; N=75N = 75.

Homogeneity of regression slopes test:

F(2,69)=4.82F(2, 69) = 4.82, p=.011p = .011slopes are significantly heterogeneous.

Standard ANCOVA is not appropriate. Regression lines are not parallel across groups.

DataStatPro automatically switches to Johnson-Neyman analysis.

The scatterplot shows:

Johnson-Neyman regions:

APA write-up: "Preliminary testing indicated that the homogeneity of regression slopes assumption was violated (F(2,69)=4.82F(2, 69) = 4.82, p=.011p = .011), indicating a significant exercise programme × fitness interaction. Consequently, standard ANCOVA was not conducted. Johnson-Neyman analysis was performed to identify regions of the fitness covariate where programme differences were statistically significant. Results indicated that for individuals with fitness scores below 42.3, the Combined and Aerobic programmes produced significantly lower depression scores than Resistance training. For fitness scores above 68.7, the Resistance programme was significantly more effective than the Aerobic programme. No significant programme differences emerged for fitness scores in the range 42.3–68.7 (representing approximately 54% of the sample). These findings suggest that optimal exercise programme selection depends on baseline fitness level."


Example 4: Non-Significant Result with Sensitivity Analysis

A nutritionist tests whether three diets (Mediterranean, Low-carb, Standard) produce different weight loss over 12 weeks, controlling for baseline BMI. nj=20n_j = 20 per group (N=60N = 60; K=3K = 3; p=1p = 1).

Results: F(2,56)=2.14F(2, 56) = 2.14, p=.128p = .128, ωp2=0.025\omega^2_p = 0.025 [95% CI: 0.000, 0.115].

Homogeneity of slopes: F(2,54)=0.88F(2, 54) = 0.88, p=.421p = .421

Levene's (adjusted residuals): F(2,57)=1.23F(2, 57) = 1.23, p=.299p = .299

Covariate FF: F(1,56)=11.42F(1, 56) = 11.42, p=.001p = .001 — baseline BMI is significantly related to weight loss ✅

Sensitivity analysis:

fp,min=7.849/(601)=0.133=0.365f_{p,min} = \sqrt{7.849/(60-1)} = \sqrt{0.133} = 0.365

ωp,min2=0.3652/(1+0.3652)=0.133/1.133=0.118\omega^2_{p,min} = 0.365^2/(1+0.365^2) = 0.133/1.133 = 0.118

The study had 80% power to detect ωp20.118\omega^2_p \geq 0.118 only. The observed ωp2=0.025\omega^2_p = 0.025 is well below this threshold; the study was underpowered for small effects.

APA write-up: "A one-way ANCOVA with diet type as the IV, 12-week weight loss as the DV, and baseline BMI as the covariate revealed no significant effect of diet type after controlling for BMI, F(2,56)=2.14F(2, 56) = 2.14, p=.128p = .128, ωp2=0.025\omega^2_p = 0.025 [95% CI: 0.000, 0.115]. Baseline BMI was a significant predictor of weight loss, F(1,56)=11.42F(1, 56) = 11.42, p=.001p = .001. All ANCOVA assumptions were satisfied. This study had 80% power to detect effects of fp0.365f_p \geq 0.365 (ωp20.118\omega^2_p \geq 0.118); the observed effect (ωp2=0.025\omega^2_p = 0.025) falls below this detection threshold, indicating the study was underpowered to detect small diet effects. A larger sample (n85n \geq 85 per group for 80% power at fp=0.25f_p = 0.25) would be required to draw conclusions about small-to-medium diet differences after BMI adjustment."


15. Common Mistakes and How to Avoid Them

Mistake 1: Not Testing the Homogeneity of Regression Slopes

Problem: Running ANCOVA without testing whether the within-group regression slopes are equal across groups. If slopes differ substantially, the ANCOVA F-test is invalid because a single pooled slope cannot adequately represent the covariate-DV relationship across all groups.

Solution: Always run the interaction F-test (group × covariate) before standard ANCOVA. Report the interaction test result. If it is significant (p<.05p < .05), do not use standard ANCOVA — use Johnson-Neyman analysis or moderated regression instead. DataStatPro flags this automatically with a red warning when the interaction is significant.


Mistake 2: Interpreting Adjusted Means Without Reporting Unadjusted Means

Problem: Reporting only adjusted (covariate-controlled) means without reporting observed (unadjusted) means. Readers need both to understand how the covariate changed the picture.

Solution: Always report a table containing both unadjusted (yˉj\bar{y}_j, SDjSD_j) and adjusted means (yˉj(adj)\bar{y}_{j(adj)}, SEj(adj)SE_{j(adj)}) for each group. Note the direction and magnitude of adjustment. Large adjustments signal that groups differed substantially on the covariate.


Mistake 3: Selecting Covariates Based on the Data (Post-Hoc Covariate Selection)

Problem: Including a covariate because it improves the significance of the group effect, or because it reduces a non-significant result to non-significance. This is p-hacking and produces results that do not replicate.

Solution: Specify covariates on theoretical grounds before data collection. Pre-register the covariate choice. If exploratory analyses suggest additional covariates, report them as exploratory and cross-validate in an independent sample.


Mistake 4: Using ANCOVA in Non-Randomised Designs as a Full Substitute for Randomisation

Problem: Claiming that ANCOVA "removes all confounding" in observational studies, yielding valid causal comparisons. ANCOVA controls only for the measured covariate and only if that covariate is measured without error and the linearity/slopes assumptions are met. Unmeasured confounders and measurement error in the covariate leave residual confounding.

Solution: Explicitly acknowledge the limitations of ANCOVA as a statistical control in non-randomised designs. Use causal language cautiously ("after adjusting for..." rather than "controlling for confounding from..."). Report reliability of the covariate. Conduct sensitivity analyses (e.g., E-value analysis for unmeasured confounding).


Mistake 5: Running Post-Hoc Tests on Unadjusted Means After ANCOVA

Problem: After a significant ANCOVA omnibus F, comparing groups using observed (unadjusted) means in pairwise t-tests or ANOVA post-hoc tests. This ignores the covariate adjustment and produces incorrect comparisons.

Solution: Always run post-hoc tests on adjusted means using the ANCOVA error term (MSerror(adj)MS_{error(adj)}, df=NKpdf = N-K-p). DataStatPro automatically applies post-hoc tests to adjusted means when run after ANCOVA.


Mistake 6: Including a Covariate That is Caused by the Treatment

Problem: Using a post-treatment variable (measured after the treatment began) as an ANCOVA covariate. If the treatment affected the covariate, adjusting for it removes part of the treatment effect — over-controlling bias that can reverse or eliminate genuine treatment effects.

Solution: Only include covariates measured before treatment began (or measured concurrently but logically independent of the treatment). Use causal diagrams (DAGs) to identify appropriate adjustment sets.


Mistake 7: Reporting Partial Effect Sizes Without Labelling Them as Partial

Problem: Reporting ηp2=0.35\eta^2_p = 0.35 without labelling it as "partial" or distinguishing it from total η2\eta^2. Partial ηp2\eta^2_p is always larger than total η2\eta^2 in ANCOVA (because the covariate variance is removed from the denominator). Readers familiar only with ANOVA η2\eta^2 will overestimate the effect.

Solution: Always label partial effect sizes explicitly: "ωp2=\omega^2_p = [value] (partial)" and note that this is the proportion of covariate-adjusted DV variance explained by group membership. Report total η2\eta^2 when comparing across ANOVA and ANCOVA analyses.


Mistake 8: Failing to Report the Covariate's Effect

Problem: Reporting only the group F-test from ANCOVA and ignoring the covariate F-test and slope. The covariate result is important for validating the ANCOVA approach (a non-significant covariate suggests it should not have been included) and for quantifying the covariate's relationship with the DV.

Solution: Always report: the covariate FF-test, degrees of freedom, p-value, the regression coefficient β^\hat{\beta} with its 95% CI, and the partial η2\eta^2 for the covariate. A non-significant covariate F-test (p>.20p > .20) is a warning sign that the covariate may not be worth including.


Mistake 9: Applying ANCOVA When Groups Differ Substantially on the Covariate (Extrapolation Risk)

Problem: In observational studies where groups differ substantially on the covariate, the adjusted means are estimated at the grand mean of the covariate — a value that may lie outside the observed range of one or more groups. This constitutes extrapolation beyond the data, producing adjusted means that are model-dependent and potentially meaningless.

Solution: Check whether the grand mean covariate value xˉ..\bar{x}_{..} falls within the observed range of each group's covariate scores. If not, consider restricting the analysis to participants within the common support region (matching or trimming). Report the covariate range for each group and acknowledge extrapolation concerns when they arise.


Mistake 10: Not Reporting Both Unadjusted and Adjusted Analyses for Observational Studies

Problem: In observational research, reporting only the ANCOVA results without showing the unadjusted ANOVA results makes it impossible for readers to assess how much the covariate changed the conclusions.

Solution: Report both unadjusted (ANOVA) and adjusted (ANCOVA) results in parallel, including both observed and adjusted group means. Explicitly describe the direction and magnitude of covariate adjustment and discuss what it implies about the group difference.


16. Troubleshooting

ProblemLikely CauseSolution
Homogeneity of slopes test is significantTrue group × covariate interaction; different relationships in different groupsUse Johnson-Neyman analysis; report interaction as a finding; do not use standard ANCOVA
Adjusted means are outside the observed rangeLarge covariate mean differences between groups; extrapolationCheck common support; restrict to overlap region; acknowledge extrapolation
Non-significant group F in ANCOVA but significant in ANOVACovariate removes variance that mediated or confounded group differencesReport both analyses; discuss whether adjustment is appropriate (randomised vs. observational)
Significant group F in ANCOVA but not in ANOVACovariate reduces error variance substantially; ANCOVA is more powerfulExpected outcome; ANCOVA result is preferred when covariate assumptions are met
Adjusted means barely differ from unadjusted meansGroups have similar covariate means (especially in RCTs); little adjustment neededThis is fine and expected in randomised designs; ANCOVA still increases power via error reduction
ωp2\omega^2_p is negativeTrue partial effect near zero; small sample; bias correction overshootsReport as 0 by convention; note small or negligible effect; increase NN
Covariate F is non-significantCovariate not linearly related to DV within groupsConsider whether covariate was correctly measured; adding it consumes dfdf without power gain — consider removing it
Very large β^\hat{\beta} with wide CISmall SSXX(W)SS_{XX(W)} (little within-group covariate variation)Check covariate distribution; if groups are very similar on covariate, the slope is poorly estimated
Cook's distance flags many influential pointsExtreme covariate or DV values; potentially meaningful outliersInvestigate each flagged observation; report analyses with and without influential points
Levene's test significant on adjusted residualsHeteroscedastic groups after covariate adjustmentUse heteroscedastic ANCOVA (HC3); use Games-Howell for post-hoc tests
Groups overlap perfectly on adjusted means despite significant FVery small pairwise differences with high power; omnibus driven by overall patternReport all pairwise comparisons; some effects may be very small but statistically significant with large NN
Ranked ANCOVA and standard ANCOVA give contradictory resultsNon-normality or outliers distorting parametric results; ranked analysis more robustReport both; prefer ranked ANCOVA when normality is violated; investigate outliers
Post-hoc tests all non-significant despite F<.001F < .001Effect distributed across many similar pairwise differences; no single pair drives itInspect all adjusted means; the omnibus test can be sensitive to a pattern of small consistent differences across many pairs
Multiple covariates produce collinearity warningsCovariates are highly intercorrelated; redundant informationRemove the least theoretically important correlated covariate; or use dimension reduction (PCA) as a single composite covariate
Adjusted SESE much larger than unadjusted SESELarge covariate mean differences between groups; additional adjustment uncertaintyThis is expected in unbalanced observational designs; report both SEs; acknowledge wide CIs
ANCOVA and gain score analysis reach different conclusionsLord's Paradox; pre-test means differ between groupsUse causal diagram to determine which analysis addresses the research question; report both with explicit interpretation of each

17. Quick Reference Cheat Sheet

Core ANCOVA Formulas

FormulaDescription
β^=SPXY(W)/SSXX(W)\hat{\beta} = SP_{XY(W)}/SS_{XX(W)}Pooled within-group regression coefficient
yˉj(adj)=yˉjβ^(xˉjxˉ..)\bar{y}_{j(adj)} = \bar{y}_j - \hat{\beta}(\bar{x}_j-\bar{x}_{..})Adjusted group mean
SSwithin(adj)=SSYY(W)SPXY(W)2/SSXX(W)SS_{within(adj)} = SS_{YY(W)} - SP_{XY(W)}^2/SS_{XX(W)}Adjusted error SS
SStotal(adj)=SSYY(T)SPXY(T)2/SSXX(T)SS_{total(adj)} = SS_{YY(T)} - SP_{XY(T)}^2/SS_{XX(T)}Adjusted total SS
SSbetween(adj)=SStotal(adj)SSwithin(adj)SS_{between(adj)} = SS_{total(adj)} - SS_{within(adj)}Adjusted between-groups SS
SScovariate=SPXY(W)2/SSXX(W)SS_{covariate} = SP_{XY(W)}^2/SS_{XX(W)}Covariate SS (reduction in error)
dfB=K1df_B = K-1; dferr=NKpdf_{err} = N-K-p; dfcov=pdf_{cov} = pDegrees of freedom
MSB(adj)=SSB(adj)/(K1)MS_{B(adj)} = SS_{B(adj)}/(K-1)Adjusted between-groups MS
MSerr(adj)=SSW(adj)/(NKp)MS_{err(adj)} = SS_{W(adj)}/(N-K-p)Adjusted error MS
F=MSB(adj)/MSerr(adj)F = MS_{B(adj)}/MS_{err(adj)}ANCOVA F-ratio for group effect
Fcov=MScov/MSerr(adj)F_{cov} = MS_{cov}/MS_{err(adj)}F-ratio for covariate
SEj(adj)=MSerr(adj)(1/nj+(xˉjxˉ..)2/SSXX(W))SE_{j(adj)} = \sqrt{MS_{err(adj)}(1/n_j+(\bar{x}_j-\bar{x}_{..})^2/SS_{XX(W)})}SE of adjusted mean
p=P(FK1,  NKpFobs)p = P(F_{K-1,\;N-K-p} \geq F_{obs})p-value for group effect

Effect Size Formulas

FormulaDescription
ηp2=SSB(adj)/(SSB(adj)+SSW(adj))\eta^2_p = SS_{B(adj)}/(SS_{B(adj)}+SS_{W(adj)})Partial eta squared (biased)
ωp2=(SSB(adj)(K1)MSerr)/(SSB(adj)+SSW(adj)+MSerr)\omega^2_p = (SS_{B(adj)}-(K-1)MS_{err})/(SS_{B(adj)}+SS_{W(adj)}+MS_{err})Partial omega squared (preferred)
εp2=(SSB(adj)(K1)MSerr)/(SSB(adj)+SSW(adj))\varepsilon^2_p = (SS_{B(adj)}-(K-1)MS_{err})/(SS_{B(adj)}+SS_{W(adj)})Partial epsilon squared
fp=ωp2/(1ωp2)f_p = \sqrt{\omega^2_p/(1-\omega^2_p)}Cohen's fpf_p (from ωp2\omega^2_p)
ηp2=FdfB/(FdfB+dferr)\eta^2_p = F\cdot df_B/(F\cdot df_B + df_{err})ηp2\eta^2_p from FF
ωp2(F1)dfB/((F1)dfB+N)\omega^2_p \approx (F-1)df_B/((F-1)df_B + N)ωp2\omega^2_p from FF (approximate)
dadj,jk=(yˉj(adj)yˉk(adj))/MSerr(adj)d_{adj,jk} = (\bar{y}_{j(adj)}-\bar{y}_{k(adj)})/\sqrt{MS_{err(adj)}}Cohen's dadjd_{adj} for pairwise
rXY(W)2=SPXY(W)2/(SSXX(W)SSYY(W))r^2_{XY(W)} = SP_{XY(W)}^2/(SS_{XX(W)}\cdot SS_{YY(W)})Pooled within-group r2r^2
ηp,cov2=SScov/(SScov+SSW(adj))\eta^2_{p,cov} = SS_{cov}/(SS_{cov}+SS_{W(adj)})Partial η2\eta^2 for covariate

ANCOVA Source Table Template

SourceSSdfdfMSFFpp
Covariate(s)SScovSS_{cov}ppMScovMS_{cov}MScov/MSerrMS_{cov}/MS_{err}[value]
Between groups (adjusted)SSB(adj)SS_{B(adj)}K1K-1MSB(adj)MS_{B(adj)}MSB(adj)/MSerrMS_{B(adj)}/MS_{err}[value]
Error (adjusted)SSW(adj)SS_{W(adj)}NKpN-K-pMSerr(adj)MS_{err(adj)}
Total (adjusted)SST(adj)SS_{T(adj)}N1pN-1-p

ANCOVA vs. ANOVA Comparison

FeatureOne-Way ANOVAANCOVA
CovariateNonep1p \geq 1 continuous covariates
Error dfdfNKN-KNKpN-K-p
Error SSSSYY(W)SS_{YY(W)}SSYY(W)SPXY(W)2/SSXX(W)SS_{YY(W)} - SP^2_{XY(W)}/SS_{XX(W)}
Group means testedObserved yˉj\bar{y}_jAdjusted yˉj(adj)\bar{y}_{j(adj)}
Additional assumptionsNoneHomogeneity of slopes; linearity; covariate independence
Power vs. ANOVABaselineHigher when $
Effect size metricω2\omega^2ωp2\omega^2_p (partial)
Post-hoc testsOn observed meansOn adjusted means

ANCOVA Reporting Checklist

ItemRequired
Statement of ANCOVA variant used (standard vs. heteroscedastic)✅ Always
Covariate(s) named with justification for inclusion✅ Always
Homogeneity of regression slopes test result✅ Always
Levene's test on adjusted residuals✅ Always
Shapiro-Wilk on adjusted residuals✅ When nj<50n_j < 50
Covariate FF, dfdf, pp, β^\hat{\beta}, CI, and partial η2\eta^2✅ Always
Group F(dfB,dferr)F(df_B, df_{err}), exact pp✅ Always
ωp2\omega^2_p with 95% CI (primary partial effect size)✅ Always
ηp2\eta^2_p (labelled as biased, partial)✅ When journals require it
Both unadjusted AND adjusted group means✅ Always
SDs (unadjusted) and SEs (adjusted) for all groups✅ Always
Sample sizes per group✅ Always
Post-hoc test name and correction method✅ When omnibus FF significant
Post-hoc tests applied to adjusted means✅ When omnibus FF significant
All pairwise adjusted mean differences with padjp_{adj} and dadj,jkd_{adj,jk}✅ When omnibus FF significant
95% CI for each pairwise adjusted mean difference✅ Recommended
Covariate balance test result✅ Always
Linearity check result✅ Recommended
Cook's distance / influential observations check✅ Recommended
εp2\varepsilon^2_p alongside ωp2\omega^2_p✅ Recommended
Cohen's fpf_p for power analysis reference✅ When reporting power
Sensitivity analysis (min detectable effect)✅ For null results
Acknowledgement of covariate limitations (reliability, residual confounding)✅ For observational studies
Johnson-Neyman region if slopes heterogeneous✅ When slopes violated
Scatterplot with per-group regression lines✅ Strongly recommended
Adjusted means plot (EMM plot) with 95% CIs✅ Strongly recommended

APA 7th Edition Reporting Templates

Standard ANCOVA (significant result):

"A one-way ANCOVA was conducted to examine the effect of [IV] on [DV], with [covariate name] included as a covariate [rationale: e.g., 'to control for pre-existing differences in...']. The homogeneity of regression slopes assumption was met (F([K1],[N2K])=F([K-1], [N-2K]) = [value], p=p = [value]). Levene's test on adjusted residuals indicated [equal / unequal] variances (F([K1],[NK])=F([K-1], [N-K]) = [value], p=p = [value]). The covariate was significantly / not significantly related to the outcome after controlling for group, F(1,[NK1])=F(1, [N-K-1]) = [value], p=p = [value], β^=\hat{\beta} = [value] [95% CI: LB, UB], ηp2=\eta^2_p = [value]. After controlling for [covariate], there was a significant effect of [IV] on [DV], F([K1],[NK1])=F([K-1], [N-K-1]) = [value], p=p = [value], ωp2=\omega^2_p = [value] [95% CI: LB, UB], indicating a [small / medium / large] effect. Adjusted means were: [Group 1] (Madj=M_{adj} = [value], SE=SE = [value]), [Group 2] (Madj=M_{adj} = [value], SE=SE = [value]), [etc.]. [Post-hoc test] comparisons on adjusted means revealed that [describe pairwise results]."

Heteroscedastic ANCOVA (unequal variances):

"Due to significant heterogeneity of variance on adjusted residuals (Levene's F([K1],[NK])=F([K-1], [N-K]) = [value], p=p = [value]), a heteroscedastic ANCOVA using HC3 variance estimation was applied. The test revealed a [significant / non-significant] effect of [IV] on [DV] after controlling for [covariate], F([K1],[dfW])=F([K-1], [df_W]) = [value], p=p = [value], ωp2=\omega^2_p = [value] [95% CI: LB, UB]. Games-Howell post-hoc comparisons on adjusted means revealed [describe results]."

Violated homogeneity of slopes (Johnson-Neyman):

"Preliminary testing indicated that the homogeneity of regression slopes assumption was violated (F([K1],[N2K])=F([K-1], [N-2K]) = [value], p=p = [value]), indicating a significant [IV] × [covariate] interaction. Consequently, standard ANCOVA was not conducted. Johnson-Neyman analysis revealed that [group difference] was statistically significant when [covariate name] was below [J-N value] and above [J-N value], but not for [covariate] values in the range [lower, upper]."

Non-significant result with sensitivity analysis:

"A one-way ANCOVA revealed no significant effect of [IV] on [DV] after controlling for [covariate], F([K1],[NK1])=F([K-1], [N-K-1]) = [value], p=p = [value], ωp2=\omega^2_p = [value] [95% CI: LB, UB]. Given the sample sizes (nj=n_j = [value] per group), this study had power to detect partial effects of fpf_p \geq [value] (ωp2\omega^2_p \geq [value]) at 80% power. The observed ωp2=\omega^2_p = [value] falls below this detection threshold."

Conversion Formulas

FromToFormula
FF, dfBdf_B, dferrdf_{err}ηp2\eta^2_pηp2=FdfB/(FdfB+dferr)\eta^2_p = F\cdot df_B/(F\cdot df_B+df_{err})
FF, dfBdf_B, NNωp2\omega^2_p (approx.)ωp2(F1)dfB/((F1)dfB+N)\omega^2_p \approx (F-1)df_B/((F-1)df_B+N)
ηp2\eta^2_pfpf_pfp=ηp2/(1ηp2)f_p = \sqrt{\eta^2_p/(1-\eta^2_p)}
ωp2\omega^2_pfpf_pfp=ωp2/(1ωp2)f_p = \sqrt{\omega^2_p/(1-\omega^2_p)}
fpf_pηp2\eta^2_pηp2=fp2/(1+fp2)\eta^2_p = f_p^2/(1+f_p^2)
ANOVA ω2\omega^2 + rXY(W)2r^2_{XY(W)}ANCOVA ωp2\omega^2_p (approx.)ωp2ω2/(1rXY(W)2)\omega^2_p \approx \omega^2/(1-r^2_{XY(W)})
Pairwise adj. differencedadj,jkd_{adj,jk}dadj,jk=Δyˉadj/MSerr(adj)d_{adj,jk} = \Delta\bar{y}_{adj}/\sqrt{MS_{err(adj)}}
dadj,jkd_{adj,jk}gadj,jkg_{adj,jk} (Hedges')gadj,jk=dadj,jk×(13/(4(NKp)1))g_{adj,jk} = d_{adj,jk}\times(1-3/(4(N-K-p)-1))

Power Gain from Covariate Reference

rXY(W)r_{XY(W)}rXY(W)2r^2_{XY(W)}Error variance retainedPower multiplier (approx.)
0.100.100.0100.01099.0%99.0\%1.0051.005
0.200.200.0400.04096.0%96.0\%1.0211.021
0.300.300.0900.09091.0%91.0\%1.0491.049
0.400.400.1600.16084.0%84.0\%1.0911.091
0.500.500.2500.25075.0%75.0\%1.1551.155
0.600.600.3600.36064.0%64.0\%1.2501.250
0.700.700.4900.49051.0%51.0\%1.4011.401
0.800.800.6400.64036.0%36.0\%1.6671.667
0.900.900.8100.81019.0%19.0\%2.2942.294

Power multiplier 1/1rXY(W)2\approx 1/\sqrt{1-r^2_{XY(W)}} relative to ANOVA (ignores dfdf cost).

Assumption Checks Reference

AssumptionTestAction if Violated
Homogeneity of regression slopesGroup × covariate interaction F-testJohnson-Neyman; moderated regression
Normality (adjusted residuals)Shapiro-Wilk, Q-Q plotQuade test; ranked ANCOVA; transform DV
Homoscedasticity (adjusted residuals)Levene's, Brown-ForsytheHeteroscedastic ANCOVA (HC3) + Games-Howell
IndependenceDesign reviewMultilevel ANCOVA
LinearityScatterplot; residual vs. CV; polynomial FAdd X2X^2; transform covariate
Covariate independence from treatmentCovariate balance test; timing checkUse pre-treatment covariates only; acknowledge confounding
Covariate reliabilityReport α\alpha or rttr_{tt}Reliability-corrected ANCOVA; report as limitation
No influential outliersCook's DD; leverage; studentised residualsInvestigate; report sensitivity; Quade test

Post-Hoc Test Selection Guide (ANCOVA)

ConditionRecommended TestControls FWER
Balanced, equal adj. variancesTukey HSD on adjusted means✅ Exactly
Unbalanced, equal adj. variancesTukey-Kramer on adjusted means✅ Approximately
Unequal adj. variancesGames-Howell on adjusted means✅ Approximately
All groups vs. one controlDunnett's on adjusted means✅ Optimal
Any design, conservativeBonferroni on adjusted means✅ Conservative
Any design, less conservativeHolm-Bonferroni on adjusted means✅ Sequential
Pre-planned specific contrastsPlanned contrasts on adjusted means✅ Reduced mm
Heterogeneous slopesJohnson-Neyman analysisN/A (regions, not FWER)
Non-parametric DVDunn + Holm on rank residuals✅ Sequential

Degrees of Freedom Reference

Sourcedfdf (1 covariate)dfdf (pp covariates)
Between groups (adjusted)K1K-1K1K-1
Covariate11pp
Error (adjusted)NK1N-K-1NKpN-K-p
Total (adjusted)N2N-2N1pN-1-p
Slopes interaction testK1K-1p(K1)p(K-1)

Cohen's Benchmarks — ANCOVA Partial Effect Sizes

Labelωp2\omega^2_pεp2\varepsilon^2_pηp2\eta^2_pfpf_p
Small0.010.010.010.010.010.010.100.10
Medium0.060.060.060.060.060.060.250.25
Large0.140.140.140.140.140.140.400.40

These benchmarks are identical to ANOVA benchmarks for partial effect sizes but apply to the covariate-adjusted variance proportion.


This tutorial provides a comprehensive foundation for understanding, conducting, and reporting ANCOVA and its alternatives within the DataStatPro application. For further reading, consult Field's "Discovering Statistics Using IBM SPSS Statistics" (5th ed., 2018) for accessible applied coverage of ANCOVA; Maxwell, Delaney & Kelley's "Designing Experiments and Analyzing Data" (3rd ed., 2018) for rigorous methodological depth including regression slopes homogeneity and planned contrasts; Rutherford's "Introducing ANOVA and ANCOVA: A GLM Approach" (2001) for a focused GLM-framework treatment; Wilcox's "Introduction to Robust Estimation and Hypothesis Testing" (4th ed., 2017) for the Quade test and robust ANCOVA alternatives; Miller & Chapman (2001) in the Journal of Abnormal Psychology for a lucid discussion of misuse of ANCOVA in non-randomised designs; Senn (2006) in Statistics in Medicine for Lord's Paradox and the ANCOVA vs. gain score debate; Bauer & Curran (2005) in Psychological Methods for probing interactions and Johnson-Neyman regions; and Lakens (2013) in Frontiers in Psychology for the ω2\omega^2 vs. η2\eta^2 discussion applied to ANCOVA. For feature requests or support, contact the DataStatPro team.