MANCOVA

*Original version written by Christoffer Åkesson

Quick facts

Number of variablesOne group variable (x)
Two test variables (y)
One or more covariates (z)
Scale of variable(s)Group variable: categorical
Test variables: continuous
Covariates: categorical or continuous

MANCOVA is similar to MANOVA, with the key difference that allows you to control for the effects of one or more extraneous variables, known as covariates (also see the discussion on confounding in X, y, and z). These covariates can take any form, i.e. they can be either categorical or continuous – but if you have a non-binary categorical covariate (i.e. one with more than two categories) you need to create dummy variables for this one (see Dummy variables).

For example, you could use a MANCOVA to evaluate the effectiveness of online learning compared to traditional learning on math and reading scores, while controlling for pre-test scores (i.e. your test variables would be “math scores’ and ‘reading scores’, your group variable would be ‘learning environment’ and your covariates would be ‘pre-test scores’). Alternatively, you could use a MANCOVA to investigate the effect of different sport drinks on athletic performance (as measured by heart rate, blood pressure and blood electrolytes), while controlling for age (i.e. your test variables would be ‘heart rate’, ‘blood pressure’ and ‘blood electrolytes’, your group variable would be ‘type of sport drink’ and your covariate would be ‘age’). 

Assumptions

First, you have to check your data to see that the assumptions behind MANCOVA hold. If your data ‘passes’ these assumptions, you will have a valid result.

Checklist

Continuous and normally distributed test variablesYour test variables should be continuous (i.e. interval/ratio) and normally distributed. For example: Income, height, weight, number of years of schooling, and so on. Although they are not really continuous, it is still very common to use ratings as continuous variables, such as: “How satisfied with your income are you?” (on a scale 1–10) or “To what extent do you agree with the previous statement?” (on a scale 1–5).
Two or more unrelated categories in the group variableYour group variable should be categorical (i.e. nominal or ordinal) and consist of two or more groups. Unrelated means that the groups should be mutually excluded: no individual can be in more than one of the groups. For example: low vs. medium vs. high educational level; liberal vs. conservative vs. socialist political views; or poor vs. fair, vs. good vs. excellent health; and so on.
Equal varianceThe variance in the test variables should be equal across the groups of the group variable.
No outliersAn outlier is an extreme (low or high) value. For example, if most individuals have a test score between 40 and 60, but one individual has a score of 96 or another individual has a score of 1, this will distort the test.
Homogenetiy of regression slopesYour test variables and any covariate(s) should have the same slopes across all levels of the categorical group variable.
Absence of multicollinearityYour test variables should not be too correlated to each other. A good rule of thumb is that no correlation should be above r = 0.90.

Function

Basic command
manova testvar testvar = groupvar c.covariate
Explanations
testvarInsert the name of the new variable
groupvarInsert the name of the group variable
covariateInsert the name of the covariate variable
Note
You need to tell Stata that a variable in your MANCOVA statement is continuous or it will treat it as another categorical factor. You denote continuous independent variables within the MANCOVA command by placing “c.” in front of them.
More information
help manova

Practical example

Dataset
StataData1.dta
Variable namegpa
Variable labelGrade point average (Age 15, Year 1985)
Value labelsN/A
Variable namecognitive
Variable labelCognitive test score (Age 15, Year 1985)
Value labelsN/A
Variable nameskipped
Variable labelSkipped class (Age 15, Year 1985)
Value labels1=Never
2=Sometimes
3=Often
Variable namesex
Variable labelSex
Value labels0=Man
1=Woman

manova gpa cognitive = skipped sex

Here, we extend the analysis from the previous section on MANOVA by adding sex as a covariate to the model formula, which gives us a MANCOVA. Specifically, we investigate whether there are differences in grade point average and cognitive test scores across the levels of skipped, while controlling for sex. Again, our null hypothesis is that there are no differences.

The F statistic (based on the Wilks’ lambda) for skipped is F=55.52. The corresponding p-value is 0.0000 (i.e. below 0.05), which allows us to reject the null hypothesis. We also see that there are statistically significant differences in gpa and cognitive between men (boys) and women (girls) (F=144.10, p <0.05).

Postestimation commands

There are many different postestimation commands that you can apply to MANCOVA.

More information
help manova postestimation

For example, we might want to obtain the mean differences between the groups. We can use the postestimation command contrast to achieve this.

First, we get the mean differences in gpa

contrast r.skipped, equation(gpa)

In the column called Contrast, we see that the mean difference in grade point average between those who sometimes have skipped class and those who have never skipped class is -0.154, controlled for sex. The mean difference between those who often have skipped class and those who have never skipped class is -0.315, controlled for sex.

And then we can obtain the mean differences in cognitive:

contrast r.skipped, equation(cognitive)

Here, we see that the mean difference in cognitive test scores between those who sometimes have skipped class and those who have never skipped class is -6.774, controlled for sex. The mean difference between those who often have skipped class and those who have never skipped class is -9.829, controlled for sex.  

We can also use the postestimation command margins, which gives us predicted means for each of the groups.

First, we get the predicted means in gpa:

margins skipped, predict(equation(gpa))

Looking at the column called Margin, we see that the predicted mean in grade point average for individuals who have never skipped class (3.302) is higher than those for individuals who sometimes (3.148), and often have skipped class (2.986), controlled for sex (thus confirming what we got with contrast).

And then we get the predicted means in cognitive:

margins skipped, predict(equation(cognitive))

Here, we see that the predicted mean in cognitive test scores for individuals who have never skipped class (313.169) is higher than those for individuals who sometimes (306.395), and often have skipped class (303.339), controlled for sex (thus confirming what we got with contrast).