← 2. Comparing groups
Analysis of covariance
Try this analysis →

Analysis of Covariance (ANCOVA)

A method for comparing adjusted mean differences between groups while accounting for covariates such as pretest scores.

CovariateAdjusted meanF testHomogeneity of regression slopes

LectureDiscussionHands-onFinish lineDifferent starts (pretest scores), compared on the same basis

Which teaching method raises exam scores more? Even if students in the hands-on class had the highest final scores, what if many of them were strong students from the start? Would the same difference remain after taking their pre-class level into account?

Analysis of covariance (ANCOVA) is a method that compares mean differences between groups while also taking into account a continuous variable that can affect the outcome. It goes one step beyond a simple comparison of means and looks at group differences on a common baseline.

One-way ANOVA compares group means directly, whereas ANCOVA adjusts for the influence of a covariate related to the outcome, such as a pretest score. Statistically controlling for a covariate, however, does not remove every bias that can arise in a study.

It is used in evaluating educational effects, health research, psychology experiments, marketing research, and more. In this article we use three teaching methods and pretest scores as an example to cover adjusted means, homogeneity of regression slopes, interpreting the results table, follow-up comparisons, and points to watch out for.

SECTION 1

What is analysis of covariance (ANCOVA)?

It compares means while also taking into account a continuous variable that can affect the outcome.

Analysis of covariance (ANCOVA) is a method that compares mean differences between groups while statistically adjusting for the influence of a continuous covariate. Beyond each group’s raw mean, it compares the adjusted mean, the mean when the covariate is set to the same reference value.

Key question: Even though scores before instruction differed, is there a difference in final exam scores by teaching method after taking that difference into account?
SECTION 2

Why control for pretest scores?

It separates levels that differed from the start from differences in outcome due to the teaching method.

Even if students in the hands-on class have higher final scores, they may have been higher achievers from the start. If you don’t take pretest scores into account, you can mistake this difference for an effect of the teaching method.

ANCOVA estimates the relationship between pretest and final scores, then compares the final scores you would expect if every group had the same pretest score. Statistical adjustment alone, however, does not remove every bias that arose from how groups were assigned.

SECTION 3

How do you tell the grouping variable, covariate, and outcome apart?

The three variables have different roles and must be placed correctly.

RoleVariable in this exampleType
Grouping variable (factor)Teaching method: lecture, discussion, hands-onCategorical, 3 levels
CovariatePretest score before instructionContinuous
OutcomeFinal exam score after instructionContinuous
Teaching methodGrouping variable · 3 levelsPretest scoreCovariate · continuousFinal exam scoreOutcome · continuousGroup effectAdjust
Variable roles in ANCOVA

As a covariate, it is common to use a pre-existing characteristic that is related to the outcome and measured before the teaching method could have affected it. Carelessly controlling for a variable that was influenced and changed by instruction can distort the interpretation.

SECTION 4

Worked example: comparing achievement by teaching method

Comparing the effects of three teaching methods while accounting for scores before instruction.

Suppose 120 hypothetical college students were assigned, 40 each, to lecture, discussion, and hands-on classes. Pretest scores were recorded before the classes started and final exam scores after they ended. The values below are hypothetical summaries for illustration, not the results of an actual analysis used to compute test statistics.

Teaching methodStudentsPretest meanFinal mean
Lecture406070
Discussion406478
Hands-on406884
55606570758085Lecture6070Discussion6478Hands-on6884Pretest meanFinal mean
Pretest and final means by teaching method
50607080901004050607080Pretest scoreFinal exam scoreSame pretest scoreLectureDiscussionHands-on
Relationship between pretest and final scores by teaching method
SECTION 5

How should you understand adjusted means?

They are the group means predicted when the covariate is set to the same level.

When the three groups’ pretest means differ (60, 64, and 68 points), there are limits to comparing the final means of 70, 78, and 84 points as they are. ANCOVA usually sets a common reference, such as the covariate mean of the whole sample, and computes each group’s predicted final score at that value.

Adjusted means differ from actual means. An adjusted mean is a model estimate that reflects the relationship between pretest and final scores, so it cannot be calculated exactly without the individual data and the regression coefficient.
SECTION 6

How is ANCOVA calculated?

It estimates the covariate’s influence and the group effect in a single linear model.

The most basic model uses the final score as the dependent variable and enters teaching method and pretest score together. You can think of it as final score = intercept + teaching method effect + regression effect of pretest score + error.

The effect of each teaching method shows how much final scores differ at the same pretest level. For this, the assumption that the slope on pretest score is the same in all three groups is important.

Model componentWhat to check
Teaching methodMean difference between groups when pretest scores are equal
Pretest scoreHow strongly it relates to final scores regardless of group
ResidualIndividual score differences the model does not explain
SECTION 7

Why does homogeneity of regression slopes matter?

Check the assumption that the covariate’s influence is the same in every group.

Basic ANCOVA assumes that in every group the slope by which the final score rises for each 1-point increase in pretest score is the same. You can first examine the teaching method × pretest score interaction to see whether the slopes differ substantially.

If the slopes differ, it may be hard to speak of a constant difference in adjusted means between groups at every pretest score. In that case, change the interpretation, for example by using a regression model that includes the interaction or by comparing groups at specific pretest levels.

Note: A nonsignificant interaction test alone does not prove that the slopes are exactly the same. Check the range of the data and the plots as well.
SECTION 8

What should you check in the results table?

Read the teaching method effect and the covariate effect separately.

In the results table, focus on the F value, degrees of freedom, p-value, and effect size for teaching method, controlling for the covariate. Also present the regression effect of the pretest score and each group’s adjusted mean with its confidence interval.

ItemQuestion for interpretation
Teaching method effectAfter adjusting for pretest scores, are the means of the three teaching methods equal?
Pretest score effectAre higher pretest scores associated with higher final scores?
Adjusted meanWhat is each group’s expected score when pretest scores are at the same reference value?
Partial η²How large is the teaching method effect relative to the other terms?

Because F values, p-values, and adjusted means cannot be computed from hypothetical group means alone, no arbitrary test values are given.

SECTION 9

If teaching methods differ, how do you compare them?

Run follow-up comparisons between groups based on adjusted means.

If the teaching method effect in ANCOVA is significant, you can compare the adjusted mean differences for lecture–discussion, lecture–hands-on, and discussion–hands-on. Present each difference’s 95% confidence interval along with multiple-comparison-adjusted results.

ComparisonQuestion of interest
Lecture vs discussionDo the two methods differ even after accounting for pretest scores?
Lecture vs hands-onIs there a difference in outcomes when pretest scores are equal?
Discussion vs hands-onDoes a difference remain between the two active learning methods?
SECTION 10

What assumptions should you check before the analysis?

Check the model’s premises and whether the groups are comparable.

Independence, normal residuals, equal variances

Check whether the observations are independent, whether the distribution of model residuals is not too asymmetric, and whether residual variances differ greatly between groups. Also check whether outliers have an excessive influence on the regression slope.

Linear relationship between covariate and outcome

Check whether pretest and final scores have a roughly linear relationship.

Overlap in covariate ranges across groups

If you compare groups whose pretest score distributions barely overlap, adjusted means may be extrapolated into ranges that were never observed.

Measuring and choosing the covariate

If the pretest score has large measurement error, or if a variable affected by instruction is used as the covariate, interpretation can run into problems.

SECTION 11

How does it differ from other analyses?

Distinguish by whether covariates are used and how many outcomes there are.

MethodDifferenceTypical situation
One-way ANOVAOne grouping variable; compares means without covariatesComparing final scores by teaching method
Two-way ANOVATwo categorical factors and a test of their interactionTeaching method × learning environment
ANCOVAGrouping variable + continuous covariateComparing teaching methods while accounting for prior scores
MANCOVAAnalyzes several continuous outcomes together with covariatesComparing comprehension and problem-solving at the same time
Linear regressionHandles continuous and categorical predictors broadlyPredicting scores and estimating relationships between variables

ANCOVA is less a separate system of calculation than one form of a linear model that includes a grouping variable and a covariate. It is also not the same as simply calculating the difference before and after instruction.

SECTION 12

How do you report ANCOVA results?

Tie together the design, assumptions, adjusted means, tests, and follow-up comparisons.

First present the sample size of each group and descriptive statistics for pretest and posttest scores, then report the definition of the covariate and the results of the homogeneity-of-slopes check. After that, describe in order the adjusted means, 95% confidence intervals, the F value, p-value, and effect size for the group effect, and any post hoc comparisons needed.

Sample report (analysis plan):

To examine differences in final exam scores across three teaching methods, a one-way analysis of covariance was planned with pretest score as the covariate. Before testing differences in adjusted means between groups, the interaction between teaching method and pretest score was examined.

Once you have actual results, report them like F(2, [error df]) = [value], p = [value], partial η² = [value]. The sample summaries in this example alone cannot determine the test values.

SECTION 13

Where can ANCOVA be used?

It is used to compare groups while accounting for differences in baseline level or basic characteristics.

FieldGroups comparedCovariateOutcome
EducationTeaching methodPretest scoreFinal exam score
HealthTreatment groupSymptom score before treatmentSymptom score after treatment
PsychologyTraining programPre-program stress scorePost-program stress score
MarketingAd typeExisting brand preferenceAttitude score after the ad
Physical educationExercise programBaseline fitness scorePerformance after the program

In randomized studies, adjusting for baseline values can improve precision; in observational studies, unmeasured confounders can remain even after controlling for covariates.

✓ Wrap-up

ANCOVA compares groups while accounting for differences in their starting points.

Going beyond simple mean differences, you interpret results with the covariate set to the same reference value.


When you compare final scores by teaching method and the pretest scores differ, simple means alone make it hard to explain differences between teaching approaches. ANCOVA estimates each teaching method’s adjusted mean by taking into account the relationship between pretest and final scores. So you need to check both how the group means and adjusted means differ and what the basis for comparison is.

Before interpreting, look at the relationship between the covariate and the outcome, the homogeneity of regression slopes, the residual assumptions, and whether the covariate distributions of the groups overlap enough. If the difference in adjusted means between groups is significant, you can proceed with follow-up comparisons, but with observational data, covariate adjustment alone does not establish a causal effect.

KEY TAKEAWAY

The key to ANCOVA is not comparing the groups’ raw means as they are, but comparing adjusted means that account for covariates related to the outcome. To interpret them correctly, check the choice of covariate and the model assumptions first.