Analysis of Covariance (ANCOVA)
A method for comparing adjusted mean differences between groups while accounting for covariates such as pretest scores.
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.
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.
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.
How do you tell the grouping variable, covariate, and outcome apart?
The three variables have different roles and must be placed correctly.
| Role | Variable in this example | Type |
|---|---|---|
| Grouping variable (factor) | Teaching method: lecture, discussion, hands-on | Categorical, 3 levels |
| Covariate | Pretest score before instruction | Continuous |
| Outcome | Final exam score after instruction | Continuous |
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.
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 method | Students | Pretest mean | Final mean |
|---|---|---|---|
| Lecture | 40 | 60 | 70 |
| Discussion | 40 | 64 | 78 |
| Hands-on | 40 | 68 | 84 |
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.
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 component | What to check |
|---|---|
| Teaching method | Mean difference between groups when pretest scores are equal |
| Pretest score | How strongly it relates to final scores regardless of group |
| Residual | Individual score differences the model does not explain |
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.
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.
| Item | Question for interpretation |
|---|---|
| Teaching method effect | After adjusting for pretest scores, are the means of the three teaching methods equal? |
| Pretest score effect | Are higher pretest scores associated with higher final scores? |
| Adjusted mean | What 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.
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.
| Comparison | Question of interest |
|---|---|
| Lecture vs discussion | Do the two methods differ even after accounting for pretest scores? |
| Lecture vs hands-on | Is there a difference in outcomes when pretest scores are equal? |
| Discussion vs hands-on | Does a difference remain between the two active learning methods? |
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.
How does it differ from other analyses?
Distinguish by whether covariates are used and how many outcomes there are.
| Method | Difference | Typical situation |
|---|---|---|
| One-way ANOVA | One grouping variable; compares means without covariates | Comparing final scores by teaching method |
| Two-way ANOVA | Two categorical factors and a test of their interaction | Teaching method × learning environment |
| ANCOVA | Grouping variable + continuous covariate | Comparing teaching methods while accounting for prior scores |
| MANCOVA | Analyzes several continuous outcomes together with covariates | Comparing comprehension and problem-solving at the same time |
| Linear regression | Handles continuous and categorical predictors broadly | Predicting 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.
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.
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.
Where can ANCOVA be used?
It is used to compare groups while accounting for differences in baseline level or basic characteristics.
| Field | Groups compared | Covariate | Outcome |
|---|---|---|---|
| Education | Teaching method | Pretest score | Final exam score |
| Health | Treatment group | Symptom score before treatment | Symptom score after treatment |
| Psychology | Training program | Pre-program stress score | Post-program stress score |
| Marketing | Ad type | Existing brand preference | Attitude score after the ad |
| Physical education | Exercise program | Baseline fitness score | Performance 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.
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.
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.