Analysis of Covariance (ANCOVA)

Statistics
Introduced by
Ronald A. Fisher
Year
1932
Type
Parametric group comparison with covariate control

What does it do?

ANCOVA is a parametric test that compares the adjusted means of two or more independent groups on a continuous outcome while statistically controlling for one or more continuous covariates.

Removing the part of outcome variance explained by the covariate reduces error variance and gives fairer comparisons when groups differ on a pre-existing characteristic. The method is usually attributed to Ronald A. Fisher, and its applied treatment, including assumptions and remedies, is given by Tabachnick and Fidell (2013).

The intuition behind the method

Imagine you are comparing exam scores across two teaching methods, but students entered the study with different prior knowledge levels. Simply comparing final scores would confound the teaching effect with pre-existing ability differences. ANCOVA algebraically adjusts every group mean for the covariate — as if all students had started at the same baseline — and then asks whether the adjusted means still differ. It is ANOVA with a statistical correction for an important nuisance variable.

History

ANCOVA is usually attributed to Ronald A. Fisher. The modern applied treatment, including assumptions, violations and remedies, is given in Tabachnick and Fidell's Using Multivariate Statistics (6th ed., 2013). ANCOVA sits between ANOVA and regression, and its logic extends to MANCOVA when several outcomes are analysed together.

When to use it

Choose ANCOVA when you compare two or more independent groups on one continuous outcome and have one or more continuous covariates that relate to the outcome but are not the focus of the comparison, typically because groups may differ on a characteristic measured before group formation. Four conditions should be checked: (1) model residuals are approximately normally distributed, checked with Shapiro-Wilk; (2) variances are homogeneous across groups, checked with Levene's test; (3) regression slopes are homogeneous, meaning the covariate-by-group interaction is not significant; (4) the covariate is not itself affected by group assignment. No fixed minimum sample size applies. With small groups the covariate slope and the adjusted means are estimated imprecisely, and the gain in power depends on the covariate-outcome correlation, the group sizes and the number of covariates. Do not use ANCOVA when the covariate is measured after treatment begins, when the slope test fails, or when the covariate has little relation to the outcome, because adjustment then consumes degrees of freedom without reducing error variance.

Limitations and considerations

  • Relies on homogeneity of regression slopes; if the covariate-outcome slope differs across groups, a single adjustment is not valid and a common adjusted mean difference cannot be interpreted.
  • Assumes the covariate is continuous and measured with little error; measurement error in the covariate can leave group differences only partly adjusted.
  • Requires the covariate to be independent of treatment; if the intervention changes the covariate, adjustment removes part of the treatment effect.
  • Small groups estimate the covariate slope and the adjusted means imprecisely, so the adjustment may not reduce error variance as expected. Sample size needs depend on the covariate-outcome correlation, the group sizes and the number of covariates.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Reduces error variance by removing the part of the outcome variance the covariate explains, which can increase power when the covariate correlates substantially with the outcome.
  • Produces adjusted group means, giving a fairer comparison when groups differ on a pre-existing characteristic.
  • Partial eta-squared gives a direct effect size for the group factor after covariate adjustment.
  • Extends one-way ANOVA by adding a regression term, so the group F test and adjusted-mean post-hoc comparisons remain the same kind of analysis.

Applications

  • Randomised controlled trials in medicine and psychology, where pre-test scores serve as covariates to adjust for baseline differences between treatment and control arms.
  • Educational research comparing instructional methods while controlling for prior academic achievement or aptitude.
  • Neuroscience studies comparing brain measures across diagnostic groups while covarying out age or total intracranial volume.
  • Organisational research comparing outcomes across departments or conditions while statistically controlling for employee tenure or experience.
  • Quasi-experimental designs where perfect random assignment was not possible and pre-existing group differences must be accounted for.

How it works

How it works

1

The null hypothesis states that all population means, after adjustment for the covariate, are equal. The alternative hypothesis states that at least one adjusted mean differs from the others. Establishing homogeneity of regression slopes is a prerequisite: the covariate must relate to the outcome with the same slope in every group. This is verified by testing the covariate-by-group interaction before the main analysis. A nonsignificant interaction is the desired result. The interaction term is then dropped, and the simple ANCOVA without an interaction term is used to produce the adjusted group means.

Formula
H_0:\ \mu_{adj,1} = \mu_{adj,2} = \cdots = \mu_{adj,k} \quad H_1:\ \text{at least one adjusted mean differs}
2

The covariate's linear relationship with the outcome is estimated and its contribution is partialled out of both the between-groups and within-group variance. The sums of squares in the formula are these covariate-adjusted values. An F ratio is then formed from the adjusted between-groups mean square divided by the adjusted error mean square. The denominator degrees of freedom are N minus the number of groups minus the number of covariates, reflecting the extra parameters the covariate consumed. Larger F values indicate that group differences persist even after removing covariate-driven variance.

Formula
F = \dfrac{MS_{\text{between (adjusted)}}}{MS_{\text{error (adjusted)}}} = \dfrac{SS_{\text{between}} / (k-1)}{SS_{\text{error}} / (N-k-p)}
3

If the p-value associated with the group F ratio is below 0.05, the null hypothesis is rejected, meaning the groups differ on the outcome beyond what the covariate explains. Effect size is reported as partial eta-squared, which expresses the proportion of residual variance accounted for by group membership. Post-hoc pairwise comparisons of adjusted marginal means (using Bonferroni or Šidák corrections) identify which specific groups differ.

Formula
\text{reject } H_0 \text{ if } p < 0.05;\quad \eta_p^2 = \dfrac{SS_{\text{between}}}{SS_{\text{between}} + SS_{\text{error}}}

Common pitfalls

  • Skipping the homogeneity of slopes pre-test: if the covariate-by-group interaction is significant, the covariate adjusts differently across groups and a standard ANCOVA is not appropriate.
  • Using a post-treatment measurement as a covariate, which can introduce collider bias and distort group estimates.
  • Interpreting unadjusted group means after running ANCOVA — always report and compare adjusted marginal means.
  • Failing to check residual normality; normality of the raw outcome scores is less critical than normality of the model residuals.
  • Reporting only the p-value without partial eta-squared or pairwise contrasts of adjusted means.

Frequently asked questions

How is ANCOVA different from one-way ANOVA?

One-way ANOVA compares raw group means ignoring any continuous covariates. ANCOVA adds a regression step that removes the variance the covariate shares with the outcome before computing the F ratio, producing adjusted means and reducing error variance. The result is typically a more powerful test when the covariate correlates substantially with the outcome.

What happens if the homogeneity of regression slopes assumption fails?

If the covariate-by-group interaction is statistically significant, the covariate-outcome relationship differs across groups, making a single pooled covariate adjustment inappropriate. Options include modelling the interaction explicitly or analysing the groups separately, so that the covariate effect is estimated within each group.

Can I use a pre-test score measured after randomisation as a covariate?

Only if the covariate was measured before the intervention began and could not have been influenced by group assignment. Using a measure collected after treatment starts introduces post-treatment bias and can produce seriously misleading adjusted means.

Which effect size should I report?

Partial eta-squared is the standard effect size for ANCOVA; it expresses the proportion of variance in the outcome accounted for by the group factor after the covariate is controlled. Interpret its magnitude against effect sizes reported in comparable studies in your field rather than against fixed cut-offs. Always accompany partial eta-squared with adjusted marginal means and their confidence intervals.

Related methods

Sources

  1. Tabachnick, B.G. & Fidell, L.S. (2013). Using Multivariate Statistics (6th ed.). Pearson.

    ISBN: 978-0205849574
  2. Applied Statistics: From Bivariate Through Multivariate Techniques, 2nd Edition, ch. 17, pp. 677-678