Combines linear regression and ANOVA Can be used to compare g treatments, after controlling for quantitative factor believed to be related to response (e.g. pre-treatment score) Can be used to compare regression equations among g groups (e.g. common slopes and/or intercepts)
3. The covariate does not affect the differences among the means of the groups (treatments). If differences among the group means were reduced when the dependent variable is adjusted for the covariate, the test for equality of group means would be less powerful. Assumption 3 can be checked by performing an ANOVA on the covariate.
we wish to compare three methods of teaching language. Three classes are available, and we assign a class to each of the teaching methods. The students are free to sign up for any one of the three classes and are therefore not randomly assigned. One of the classes may end up with a disproportionate share of the best students, in which case we cannot claim that teaching methods have produced a significant difference in final grades. However, we can use previous grades or other measures of performance as covariates and then compare the students’ adjusted scores for the three methods.
We assume: Z is less than full rank as in overparameterized ANOVA models and X is full-rank as in regression models and Parameter estimation:
The test statistic is given by:
The test statistic is: which is distributed as F[k-1, k(n-2)] when is true.
Model: Estimation:
Test for main effects and interaction Test for Slope Vector Test for Homogeneity of Slope Vectors: that the k regression planes (for the k treatments) are parallel.
Blocking – may be the best alternative: Because it doesn’t have the special assumptions of ANCOVA Because it can capture non-linear relationships between CV and DV where ANCOVA only deals with linear relationships.
GLM Univariate
data glue; input FormulationStrengthThickness; datalines; ; run; proc glm; class formulation; model strength = thickness formulation / solution ; lsmeans formulation / stderr pdiff; run;
Stat > ANOVA > General Linear Model … > Responses: Strength > Model: Formulation > Covariates: Thickness > Options: Adjusted (Type III) Sums of Squares Factor Plots… > Main Effects Plot > Formulation
23-25 > glue <- read.table("glue.txt",header=TRUE) > glue$Formulation <- as.factor(glue$Formulation) > # fit linear models: full, thickness only, formulation only > full.lm <- lm(Strength ~ Formulation + Thickness, data=glue) > thick.lm <- lm(Strength ~ Thickness, data=glue) > formu.lm <- lm(Strength ~ Formulation, data=glue) > > anova(thick.lm,full.lm) Analysis of Variance Table Model 1: Strength ~ Thickness Model 2: Strength ~ Formulation + Thickness Res.Df RSS Df Sum of Sq F Pr(>F) > anova(formu.lm,full.lm) Analysis of Variance Table Model 1: Strength ~ Formulation Model 2: Strength ~ Formulation + Thickness Res.Df RSS Df Sum of Sq F Pr(>F) e-05 *** Test for Formulation differences Test for significance of Thickness
23-26 > summary(full.lm) Call: lm(formula = Strength ~ Formulation + Thickness, data = glue) Residuals: Min 1Q Median 3Q Max Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) e-14 *** Formulation Formulation Formulation Thickness e-05 *** > summary(thick.lm) Call: lm(formula = Strength ~ Thickness, data = glue) Residuals: Min 1Q Median 3Q Max Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) < 2e-16 *** Thickness e-06 *** Residual standard error: on 18 degrees of freedom Multiple R-Squared: , Adjusted R-squared: F-statistic: on 1 and 18 DF, p-value: 4.317e-06 Full model (can be refined by omitting formulation) Reduced model (formulation omitted)