Mail a PDF copy of this page to:
(Your email address will not be added to a mailing list)
Skip to main content
Show menu

Analysis of covariance

Next selectANOVA
Next selectAnalysis of covariance


Analysis of covariance (ANCOVA) allows to compare one variable in 2 or more groups taking into account (or to correct for) variability of other variables, called covariates.

Analysis of covariance combines one-way or two-way analysis of variance with linear regression (General Linear Model, GLM).

How to enter data

Data entry for ANCOVA

In this example (data from Wildt & Ahtola, 1978) data are entered for 2 factor variables named "FactorA" and "FactorB". The variable "VarY" is the dependent variable and there is one covariate "VarX".

Required input

ANCOVA dialog box

In the dialog box for ANCOVA you select:


Optionally, select a Test for Normal distribution of the residuals.


ANCOVA results

Levene's test for equality of variances

Prior to the ANCOVA test, Levene's test for equality of variances is performed. If the Levene test is positive (P<0.05) then the variances in the groups are different (the groups are not homogeneous), and therefore the assumptions for ANCOVA are not met.

Homogeneity of regression slopes

The interpretation of ANCOVA and the associated adjusted means relies on the assumption of homogeneous regression slopes for the various groups (Huitema, 1980). If this assumption is not met (P<0.05) the ANCOVA results are unreliable.

Tests of Between-Subjects Effects

If the calculated P-values for the two main factors A and B, or for the 2-factor interaction is less than the conventional 0.05 (5%), then the corresponding null hypothesis is rejected, and you accept the alternative hypothesis that there are indeed differences among groups.

When the 2-factor interaction (FactorA*FactorB) is significant the effect of factor A is dependent on the level of factor B, and it is not recommended to interpret the means and differences between means (see below) of the main factors.

Estimated marginal means

In the following tables, the marginal means (sometimes referred to as "corrected means") with standard error and 95% Confidence Interval are given for all levels of the two factors. Also, differences between groups, with Standard Error, and Bonferroni corrected P-value and 95% Confidence Interval of the differences are reported.

ANCOVA - Estimated marginal means

General Linear Model

Since this ANCOVA procedure is an implementation of the General Linear Model (GLM), the procedure:

Analysis of residuals

ANCOVA analysis assumes that the residuals (the differences between the observations and the modelled values) follow a Normal distribution. This assumption can be evaluated with a formal test, or by means of graphical methods.

The different formal Tests for Normal distribution may not have enough power to detect deviation from the Normal distribution when sample size is small. On the other hand, when sample size is large, the requirement of a Normal distribution is less stringent because of the central limit theorem.

Therefore, it is often preferred to visually evaluate the symmetry and peakedness of the distribution of the residuals using the Histogram, Box-and-whisker plot, or Normal plot.

To do so, you click the hyperlink "Save residuals" in the results window. This will save the residual values as a new variable in the spreadsheet. You can then use this new variable in the different distribution plots.


See also

External links

Recommended book

Primer of Applied Regression & Analysis of Variance.
Glantz, Stanton, Slinker, Bryan

Buy from Amazon US - CA - UK - DE - FR - ES - IT

Primer of Applied Regression & Analysis of Variance is a textbook especially created for medical, public health, and social and environmental science students who need applied (not theoretical) training in the use of statistical methods. The book has been acclaimed for its user-friendly style that makes complicated material understandable to readers who do not have an extensive math background.

The text is packed with learning aids that include chapter-ending summaries and end-of-chapter problems that quickly assess mastery of the material. Examples from biological and health sciences are included to clarify and illustrate key points. The techniques discussed apply to a wide range of disciplines, including social and behavioral science as well as health and life sciences. Typical courses that would use this text include those that cover multiple linear regression and ANOVA.

This site uses cookies to store information on your computer. More info...