Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Analysis of covariance
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|General linear model that blends ANOVA and regression}} {{redirect|Ancova|the moth genus|Ancova (moth)}} '''Analysis of covariance''' ('''ANCOVA''') is a [[general linear model]] that blends [[ANOVA]] and [[regression analysis|regression]]. ANCOVA evaluates whether the means of a [[dependent variable]] (DV) are equal across levels of one or more [[Categorical variable|categorical]] [[independent variable]]s (IV) and across one or more continuous variables. For example, the categorical variable(s) might describe treatment and the continuous variable(s) might be [[covariate]]s (CV)'s, typically nuisance variables; or vice versa. Mathematically, ANCOVA decomposes the variance in the DV into variance explained by the CV(s), variance explained by the categorical IV, and residual variance. Intuitively, ANCOVA can be thought of as 'adjusting' the DV by the group means of the CV(s).<ref>Keppel, G. (1991). ''Design and analysis: A researcher's handbook'' (3rd ed.). Englewood Cliffs: Prentice-Hall, Inc.</ref> The ANCOVA model assumes a linear relationship between the response (DV) and covariate (CV): <math>y_{ij} = \mu + \tau_i + \Beta(x_{ij} - \overline{x}) + \epsilon_{ij}.</math> In this equation, the DV, <math>y_{ij}</math> is the jth observation under the ith categorical group; the CV, <math>x_{ij}</math> is the ''j''th observation of the covariate under the ''i''th group. Variables in the model that are derived from the observed data are <math>\mu</math> (the grand mean) and <math>\overline{x}</math> (the global mean for covariate <math>x</math>). The variables to be fitted are <math>\tau_i</math> (the effect of the ''i''th level of the categorical IV), <math>B</math> (the slope of the line) and <math>\epsilon_{ij}</math> (the associated unobserved error term for the ''j''th observation in the ''i''th group). Under this specification, the categorical treatment effects sum to zero <math>\left(\sum_i^a \tau_i = 0\right).</math> The standard assumptions of the linear regression model are also assumed to hold, as discussed below.<ref name="Montgomery, Douglas C 2012">Montgomery, Douglas C. "Design and analysis of experiments" (8th Ed.). John Wiley & Sons, 2012.</ref> ==Example== In an agricultural study, ANCOVA can be used to analyze the effect of different fertilizers (<math>\tau_i</math>) on crop yield (<math>y_{ij}</math>), while accounting for soil quality (<math>x_{ij}</math>) as a covariate. Soil quality, a continuous variable, influences crop yield and may vary across plots, potentially confounding the results. The model adjusts yield measurements for soil quality differences and evaluates whether fertilizer types differ significantly. Mathematically, this can be expressed as: <math> y_{ij} = \mu + \tau_i + \beta (x_{ij} - \overline{x}) + \epsilon_{ij}, </math> where: * <math>y_{ij}</math> is the crop yield for the <math>j</math>-th plot under the <math>i</math>-th fertilizer type, * <math>\mu</math> is the grand mean crop yield, * <math>\tau_i</math> represents the effect of the <math>i</math>-th fertilizer type, subject to the constraint <math>\sum_i \tau_i = 0</math> for identifiability, * <math>\beta</math> is the slope of the regression line representing the relationship between soil quality and crop yield, * <math>x_{ij}</math> is the soil quality for the <math>j</math>-th plot under the <math>i</math>-th fertilizer type, and <math>\overline{x}</math> is the global mean soil quality, * <math>\epsilon_{ij}</math> is the residual error term, assumed to be normally distributed with mean 0 and variance <math>\sigma^2</math>. In this setup, ANCOVA partitions the total variance in crop yield into variance explained by soil quality (covariate), variance explained by fertilizer type (categorical IV), and residual variance. By adjusting for soil quality, ANCOVA provides a more precise estimate of the fertilizer effect on crop yield. The constraint <math>\sum_{i} \tau_i = 0</math> ensures that the categorical variable's effects are centered around zero, allowing for meaningful interpretation of group differences. It is standard in ANOVA and ANCOVA with categorical variables. ==Uses== ===Increase power=== ANCOVA can be used to increase [[statistical power]] (the probability a [[Statistical significance|significant difference]] is found between groups when one exists) by reducing the within-group error [[variance]].<ref>{{cite book |last1=Tabachnick |first1=B. G. |last2=Fidell |first2=L. S. |year=2007 |title=Using Multivariate Statistics |edition=5th |location=Boston |publisher=Pearson Education }}</ref> In order to understand this, it is necessary to understand the test used to evaluate differences between groups, the [[F-test]]. The ''F''-test is computed by dividing the explained variance between groups (e.g., medical recovery differences) by the unexplained variance within the groups. Thus, :<math> F = \frac{MS_{between} }{MS_{within}} </math> If this value is larger than a critical value, we conclude that there is a significant difference between groups. Unexplained variance includes error variance (e.g., individual differences), as well as the influence of other factors. Therefore, the influence of CVs is grouped in the denominator. When we control for the effect of CVs on the DV, we remove it from the denominator making ''F'' larger, thereby increasing our power to find a significant effect if one exists at all. [[File:ANCOVA - Partitioning Variance.jpg|right|Partitioning variance]] ===Adjusting preexisting differences=== Another use of ANCOVA is to adjust for preexisting differences in nonequivalent (intact) groups. This controversial application aims at correcting for initial group differences (prior to group assignment) that exists on DV among several intact groups. In this situation, participants cannot be made equal through random assignment, so CVs are used to adjust scores and make participants more similar than without the CV. However, even with the use of covariates, there are no statistical techniques that can equate unequal groups. Furthermore, the CV may be so intimately related to the categorical IV that removing the variance on the DV associated with the CV would remove considerable variance on the DV, rendering the results meaningless.<ref>{{cite journal |last1=Miller |first1=G. A. |last2=Chapman |first2=J. P. |year=2001 |title=Misunderstanding Analysis of Covariance |journal=Journal of Abnormal Psychology |volume=110 |issue=1 |pages=40–48 |doi=10.1037/0021-843X.110.1.40 |pmid=11261398 }}</ref> ==Assumptions== There are several key assumptions that underlie the use of ANCOVA and affect interpretation of the results.<ref name="Montgomery, Douglas C 2012"/> The standard [[regression analysis|linear regression]] assumptions hold; further we assume that the slope of the covariate is equal across all treatment groups (homogeneity of regression slopes). ===Assumption 1: linearity of regression === The regression relationship between the dependent variable and concomitant variables must be linear. ===Assumption 2: homogeneity of error variances=== The error is a random variable with conditional zero mean and equal variances for different treatment classes and observations. ===Assumption 3: independence of error terms=== The errors are uncorrelated. That is, the error covariance matrix is diagonal. [[File:Homogeneity of Regression Slopes.png|thumb|308x308px]] ===Assumption 4: normality of error terms=== The [[Errors and residuals in statistics|residuals (error terms)]] should be normally distributed <math>\epsilon_{ij}</math> ~ <math>N(0, \sigma^2)</math>. ===Assumption 5: homogeneity of regression slopes=== The slopes of the different regression lines should be equivalent, i.e., regression lines should be parallel among groups. The fifth issue, concerning the homogeneity of different treatment regression slopes is particularly important in evaluating the appropriateness of ANCOVA model. Also note that we only need the error terms to be normally distributed. In fact both the independent variable and the concomitant variables will not be normally distributed in most cases. ==Conducting an ANCOVA == ===Test [[multicollinearity]]=== If a CV is highly related to another CV (at a correlation of 0.5 or more), then it will not adjust the DV over and above the other CV. One or the other should be removed since they are statistically redundant. ===Test the homogeneity of variance assumption=== Tested by [[Levene's test]] of equality of error variances. This is most important after adjustments have been made, but if you have it before adjustment you are likely to have it afterwards. ===Test the homogeneity of regression slopes assumption=== To see if the CV significantly interacts with the categorical IV, run an ANCOVA model including both the IV and the CVxIV interaction term. If the CVxIV interaction is significant, ANCOVA should not be performed. Instead, Green & Salkind<ref name="Green">Green, S. B., & Salkind, N. J. (2011). ''Using SPSS for Windows and Macintosh: Analyzing and Understanding Data'' (6th ed.). Upper Saddle River, NJ: Prentice Hall.</ref> suggest assessing group differences on the DV at particular levels of the CV. Also consider using a [[Moderation (statistics)|moderated regression analysis]], treating the CV and its interaction as another IV. Alternatively, one could use [[Mediation (statistics)|mediation analyses]] to determine if the CV accounts for the IV's effect on the DV{{Citation needed|date=December 2022}}. ===Run ANCOVA analysis=== If the CV×IV interaction is not significant, rerun the ANCOVA without the CV×IV interaction term. In this analysis, you need to use the adjusted means and adjusted [[mean squared error]]. The adjusted means (also referred to as least squares means, LS means, estimated marginal means, or EMM) refer to the group means after controlling for the influence of the CV on the DV. [[File:Main Effects.jpg|thumb|Simple main effects plot showing a small Interaction between the two levels of the independent variable.]] ===Follow-up analyses=== If there was a significant [[main effect]], it means that there is a significant difference between the levels of one categorical IV, ignoring all other factors.<ref name="Howell">Howell, D. C. (2009) ''Statistical methods for psychology'' (7th ed.). Belmont: Cengage Wadsworth.</ref> To find exactly which levels are significantly different from one another, one can use the same follow-up tests as for the ANOVA. If there are two or more IVs, there may be a [[Interaction (statistics)|significant interaction]], which means that the effect of one IV on the DV changes depending on the level of another factor. One can investigate the simple main effects using the same methods as in a [[Factor analysis|factorial ANOVA]]. ==Power considerations== While the inclusion of a covariate into an ANOVA generally increases [[statistical power]]<ref>{{cite journal |last1=Barrett |first1=Timothy J. |title=Computations using analysis of covariance |journal=WIREs Computational Statistics |date=2011 |volume=3 |issue=3 |pages=260–268 |doi=10.1002/wics.165 |url=https://wires.onlinelibrary.wiley.com/doi/abs/10.1002/wics.165 |language=en |issn=1939-0068|url-access=subscription }}</ref> by accounting for some of the variance in the dependent variable and thus increasing the ratio of variance explained by the independent variables, adding a covariate into ANOVA also reduces the [[Degrees of freedom (statistics)|degrees of freedom]]. Accordingly, adding a covariate which accounts for very little variance in the dependent variable might actually reduce power. ==See also== * [[MANCOVA]] (Multivariate analysis of covariance) ==References== {{Reflist}} ==External links== {{Wikiversity|ANCOVA}} * [https://www.southampton.ac.uk/~cpd/anovas/datasets/index.htm Examples of all ANOVA and ANCOVA models with up to three treatment factors, including randomized block, split plot, repeated measures, and Latin squares, and their analysis in R] (University of Southampton) * [http://vassarstats.net/ancova2L.html One-Way Analysis of Covariance for Independent Samples] * [https://spss-tutor.com/ancova.php What is analysis of covariance used for?] * [http://journals.cambridge.org/action/displayAbstract?fromPage=online&aid=1296348 Use of covariates in randomized controlled trials by G.J.P. Van Breukelen and K.R.A. Van Dijk (2007)] {{Statistics|correlation|state=collapsed}} {{Experimental design|state=collapsed}} {{Least Squares and Regression Analysis|state=collapsed}} [[Category:Analysis of variance]] [[Category:Covariance and correlation]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Experimental design
(
edit
)
Template:Least Squares and Regression Analysis
(
edit
)
Template:Redirect
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Statistics
(
edit
)
Template:Wikiversity
(
edit
)