2 of 43 When and Why do we use ANCOVA? Partitioning Variance Doing ANCOVA using SPSS Interpretation – Main Effects – Covariates Analysis of Covariance
3 of 43 What is ANCOVA? ANOVA can be extended to include one or more continuous variables, termed covariates, that are not part of the main experimental manipulation, but have an influence on the DV. ANCOVA tests whether manipulated factors (IVs) have a significant effect on the DV after removing-- or partialing out--the variance accounted for by the covariates.
4 of 43 Accounting for Variance: With and Without a Covariate SS R without Covariate SS R SS M SS R = Systematic Variance Unsystematic Variance SS R with Covariate Variance explained by the covariate reduces the overall amount of unexplained (error) variance. SS R SS M SS Cov
5 of 43 Purpose of Covariates in ANOVA Reduce error variance – The F-ratio in ANOVA compares the amount of variability explained by the experimental manipulation (MS M ), against the variability that it cannot explain (MS R ). What we hope is that the covariate explains some of the variance that was previously unexplained. This has the effect of reducing the unexplained variance (i.e., MS R becomes smaller) and so our F-ratio gets bigger. In real terms this means we obtain a more sensitive measure of the experimental effect. Eliminate Confounds – In any experiment, there may be unmeasured variables that confound the results (i.e., a variable that varies systematically with the experimental manipulation). If any variables are known to influence the dependent variable being measured, then ANCOVA can help to remove the bias of these variables. Once a possible confounding variable has been identified, it can be measured and entered into the analysis as a covariate. ANCOVA is like an ANOVA on the values of the DV, after removing the influence of the covariate, rather than on the original values.
6 of 43 Example 1: Using ANCOVA to evaluate the relative effectiveness of competing math textbooks An educational psychologist is interested in evaluating the relative effectiveness of two textbooks for improving math skills. A literature review reveals that general IQ is related to math skills. She uses this information to make the test of the association between math skills and textbook type more sensitive (i.e., more powerful). Procedure – In each one of the two textbook groups, we compute the correlation coefficient between IQ and math skills. – We then estimate the amount of variation in math skills that is accounted for by IQ, and the amount of residual variation (the variance in math skills not explained by IQ). – We use the residual variance in an ANOVA as an estimate of the true unexplained variance (error) after controlling for IQ.
7 of 43 Example 2: Evaluating the effectiveness of the types of treatment for treating a fatal disease A researcher compares the effectiveness of three treatments ("Placebo", "Drug 1", and "Drug 2”) for treating a fatal disease in terms of average survival time. ANOVA could be used to analyze these data. But, suppose that supplementary information is available to him (i.e., each patients’ age). Age in this case is a "covariate" - it is not related to treatment, but it might be related to survival time. He uses the information to make the test of the association between survival time and treatment type more sensitive (more powerful). – In each of the treatment groups, he computes the correlation coefficient between age and survival time. – He estimates the amount of variation in survival time accounted for by age, and the amount of residual variation that is not explained by age. – He uses the residual variance in an ANOVA as an estimate of the true error after controlling for age.
8 of 43 Choosing Covariates In general, it is preferable to have a small number of covariates. Covariates should be correlated with the DV, but NOT with each other. – When covariates are significantly correlated: they contribute very little to error reduction they can cause computational difficulties such as multicollinearity. one or the other should be removed since they are statistically redundant.
9 of 43 Assumptions of ANCOVA ANCOVA has the same basic assumptions of all of the parametric tests, but also has two additional requirements: 1.independence of the covariate and treatment effect. 2.homogeneity of regression slopes.
10 of 43 Assumptions of ANCOVA: Independence of the covariate and treatment effect We assume the covariate is correlated with the outcome variable (DV), so that as scores on the covariate change, scores on the DV change by a similar amount. Important to ensure that: the covariate explains previously unexplained variance in the DV—not variance explained by the treatment. the effect that the covariate has on the outcome should be the same for all of the experimental groups. – Randomizing participants to experimental groups or matching experimental groups on the covariate can help. – Important to test this before running the ANCOVA.
11 of 43 Basic ANOVA showing that the total variance in the DV can be partitioned into treatment variance (SS M ) and error or unexplained variance (SS R ). Ideal situation for ANCOVA in which the covariate shares variance with the currently “unexplained” variance, but is independent from the treatment effect (no overlapping variance). Situation in which ANCOVA should NOT be used since the effect of the covariate overlaps with the experimental effect. Thus, the experimental effect is confounded with the effect of the covariate.
12 of 43 What ANCOVA actually does is to create a single regression equation, ignoring groups, to predict dependent variable (Y) scores using the covariate(s) (X 1, X 2, X 3 ). Then, in essence, an ANOVA, not ignoring groups, is performed using the residualized scores of each person computed by subtracting each person’s predicted score based on the single equation, from the participants’ actual scores. These computations are legitimate if the regression equations that predict the Y scores, computed separately in the ANOVA groups, have parallel slopes. This is the homogeneity of regression assumption, which requires that the “b” weight applied to the covariates are reasonably equal across each group. Assumptions of ANCOVA: Homogeneity of Regression Slopes
13 of 43 The slope of the line predicting the DV from the CV should be relatively the same for each level of the IV. – In other words the regression coefficient (b i ) relating a particular CV to the DV should be the same for each group. – In still other words, this means no IV x DV interaction. Assumptions of ANCOVA: Homogeneity of Regression Slopes
14 of 43 Sample ANCOVA Problem: Viagra and Libido Previously, we considered an example looking at the effects of Viagra on libido. Viagra was shown to influence libido, but other factors could also play a role in explaining a person’s libido, including their health, mood, and their partner’s libido. If one or more of these variables is measured, it is possible to control for the influence they have on the dependent variable by including them in the analysis. In the context of hierarchical regression, we would enter one or more of these variables into the model in the first block, followed by entry of the “dummy variables” representing the experimental manipulation in the second block. As such, we “partial out” the effect of the covariates (e.g., their partner’s libido) to see what effect the independent variable has after the effect of the covariate.
16 of 43 How Does ANCOVA Work? Imagine we had just two groups: – Placebo – Low Dose This paradigm can be expressed as a regression equation using a dummy coding variable:
17 of 43 Dummy Coding – Placebo = 0, Low Dose = 1 – When Dose = Placebo, Predicted Libido = mean of placebo group: – When Dose = Low Dose, Predicted Libido = Difference between the means of the Placebo and Low Dose groups:
18 of 43 ANCOVA and the GLM We can run a regression with Libido as the outcome and the Dose (Placebo or Low) as the predictor, Note: – Intercept is the mean of Placebo group – b for the Dummy Variable is the difference between the means of the placebo and low dose group ( = 1.66)
19 of 43 ANCOVA as Regression The covariate can be added to the regression model of the ANOVA. To evaluate the effect of the experimental manipulation controlling for the covariate we enter the covariate into the model first (think back to hierarchical regression), then next the dummy coded IV (dose of Viagra). Y i = b 0 + b 3 Covariate i + b 2 High i + b 1 Low i + ε i Y i = b 0 + b 3 Partner’s Libido i + b 2 High i + b 1 Low i + ε i
20 of 43 SPSS Output: ANCOVA as Regression
21 of 43 SPSS Output: ANCOVA as Regression
22 of 43 ANCOVA Initial Considerations: Testing Independence of the IV and Covariate
23 of 43 Initial Considerations: One-Way ANOVA using Partner’s Libido as the DV The non-significant F-test (p>.05) tells us that the treatment groups do not differ significantly on the covariate (Partner’s libido).
24 of 43 ANCOVA: Main Analysis
25 of 43 ANCOVA: Contrasts Note that the “Post-Hoc” option isn’t available for analyses using covariates. Be sure to “click” on the “Change” button!
26 of 43 ANCOVA: Options You can perform “Post-Hoc” tests through “Options”. 1.Move the IV, “Dose”, into the “Display Means for” box. 2.“Click” on the “Compare main effects” box. 3.The “Confidence interval adjustment” option becomes available. 4.The resulting output will be a table of estimated marginal means (the means adjusted for the effect of the covariate).
27 of 43 SPSS Output: Descriptive Statistics and Homogeneity test
28 of 43 Testing for Equal Variance: Different Approaches Levene’s Test – If Levene’s test is significant, a more stringent alpha can be used (.01) or the variable can be dropped from the analysis. – This is a very conservative test and is not necessarily the best way to judge whether variances are unequal enough to cause problems. Alternative Procedure: Highest and lowest variances – Obtain standard deviation values for each of the groups; square these values to obtain the variances. – Take the largest value and divide it by the smallest value. If the resulting value is less than 2, then we shouldn’t worry too much. If it is larger than 2, then we do (see next slide).
29 of 43 The ratio of the highest variance (4.49) to lowest variance (2.13) = Look up the critical value for 10 subjects, and 3 variances. Critical value = 5
30 of 43 SPSS Output: Main Analysis ANOVA ANCOVA
31 of 43 The Main Effect F(2, 26) = 4.14, p <.05
32 of 43 SPSS Output: Parameter Estimates Dummy Coded Variables Dose = 1: Represents the difference between the Placebo and High Dose groups. Dose = 2: Represents the difference between the Low Dose and High Dose groups. Dose = 3: The High Dose reference group.
33 of 43 SPSS Output: Planned Contrasts Low dose vs. Placebo High dose vs. Placebo Adjusted Means
34 of 43 SPSS Output: Post-Hoc Tests Note: Difference between Placebo and Low Dose groups is no longer significant (p>.05).
35 of 43 Assumption of Homogeneity of Regression Slopes We assume the relationship between the DV and covariate is the same in each treatment group.
36 of 43 Re-run the ANCOVA: Custom Model The purpose: To test the Covariate by Outcome Interaction. If the interaction is significant, the homogeneity of regression slopes has been violated.
37 of 43 Step 1Step 2 Step 3
38 of 43 SPSS Output: Testing the Dose*Partner_Libido Interaction
39 of 43 Calculating Effect Size for ANCOVA Eta squared ( 2 ) is essentially r 2. Derived by dividing SS M by SS T. Assesses the proportion of total variance explained by a variable. Partial eta squared (partial 2 ) assesses the proportion of variance that a variable explains that is not explained by other variables in the analysis. 2 = SS Effect SS Total Partial 2 = SS Effect SS Effect + SS Residual
40 of 43 Calculating Effect Size for ANCOVA Partial 2 Dose = SS Dose SS Dose + SS Residual Partial 2 Partner Libido = SS PartnerLibido SS PartnerLibido + SS Residual = =.24 = =.16 These values show that Dose explained a bigger proportion of the variance not attributable to other variables than Partner_Libido
41 of 43 ANCOVA: Reporting the Results The covariate, partner’s libido, was significantly related to the participant’s libido, F(1,26) = 4.96, p<.05, r =.40. There was also a significant effect of Viagra on levels of libido after controlling for the effect of partner’s libido, F(2,26) = 4.14, p<.05, partial 2 =.24. Planned contrasts revealed that having a high dose of Viagra significantly increased libido compared to having a placebo, t(26) = -2.77, p.05, r =.11. (see pp for specifics of results reporting).
42 of 43 Sample Problem #1: Hangover Cures A marketing manager for a well-known beverage manufacturer (Alka- Seltzer) believes his product is more effective than other recommended hangover “cures.” To test his product against competitor cures he invites 15 people to join him at a bar and proceeds to get them drunk. The next morning, he gives 5 of them strong coffee to drink (which is assumed to have no beneficial effect), 5 of them Alka Seltzer, and 5 of them Mimosas (champagne and orange juice—”hair of the dog that bit them”). This variable is called “drink”. He measures how well they feel two hours later on a Likert-type scale with the following anchors: 0 = “I feel terrible” to 10 “I feel terrific”. This variable is called “well”. The marketing manager realizes that it is important to control for how drunk the person got the night before, and so he measures this on another Likert-type scale with the following anchors: 0 = “Completely sober” to 10 = “Completely intoxicated”. This variable is called “drunk”.
43 of 43 Hangover Cures Dataset Your task: Conduct the appropriate analyses to see whether the drinks differ in their ability to treat hangovers when controlling for how much was drunk the night before. (Hint: Run the ANOVA first, then the ANCOVA). Write up your results. Is Alka Seltzer better than the other cures? What will you conclude from the study? Strong CoffeeAlka SeltzerMimosas WellDrunkWellDrunkWellDrunk