Skip to content
Prev 300877 / 398503 Next

car::Anova - Can it be used for ANCOVA with repeated-measures factors.

Dear John,

indeed, you are very right. Including the covariate as is, doesn't make any sense. The only correct way would be to center it on the mean beforehands. So actually the examples in my first and second mail are bogus (I add a corrected example at the end) and the reported test do not make much sense.

Let me try to explain why I want to discard the interactions of the covariate with the within-factors. The reason I want to exclude them is that I want to stay within the ANCOVA framework. I looked at the three books on experimental design I have on my desk (Winer, 1971; Kirk, 1982; Maxwell & Delaney, 2003) and they unanimously define the ANCOVA as the ANOVA on the responses controlled for the covariate only (i.e., not controlled for the covariate and the interactions with the other effects).
However, as you say, adding or removing an interaction with the orthogonal within-subject factors does indeed not alter the results (example at the end), so one could just use the output and discard the unwanted effects, although admittedly this seems sketchy given significant effects.

Unfortunately, my involvement with this issue has led me to another question. Winer and Kirk both discuss a split-plot ANCOVA in which one has measured a covariate for each observation. That is a second matrix alike the original data matrix, e.g. the body temperature of each person at each measurement for the OBrienKaiser dataset:

OBK.cov <- OBrienKaiser
OBK.cov[,-(1:2)] <- runif(16*15, 36, 41)

Would it be possible to fit the data using this temperature matrix as a covariate using car::Anova (I thought about this but couldn't find any idea of how to specify the imatrix)?

Thanks a lot for the helpful responses,
Henrik


PS: Better examples:
# compare the treatment and the phase effect across models.
require(car)
set.seed(1)

# using scale for the covariate:
n.OBrienKaiser <- within(OBrienKaiser, age <- scale(sample(18:35, size = 16, replace = TRUE), scale = FALSE))

phase <- factor(rep(c("pretest", "posttest", "followup"), c(5, 5, 5)), levels=c("pretest", "posttest", "followup"))
hour <- ordered(rep(1:5, 3))
idata <- data.frame(phase, hour)

# Full ANCOVA model:
mod.1 <- lm(cbind(pre.1, pre.2, pre.3, pre.4, pre.5, post.1, post.2, post.3, post.4, post.5,
           fup.1, fup.2, fup.3, fup.4, fup.5) ~  treatment * gender + age, data=n.OBrienKaiser)
(av.1 <- Anova(mod.1, idata=idata, idesign=~phase*hour, type = 3))

#                             Df test stat approx F num Df den Df      Pr(>F)
# (Intercept)                  1     0.968    269.4      1      9 0.000000052 ***
# treatment                    2     0.443      3.6      2      9      0.0719 .
# gender                       1     0.305      3.9      1      9      0.0782 .
# age                          1     0.054      0.5      1      9      0.4902
# treatment:gender             2     0.222      1.3      2      9      0.3232
# phase                        1     0.811     17.2      2      8      0.0013 **
# ...

# removing the between-subject interaction does alter the lower order effects:
mod.2 <- lm(cbind(pre.1, pre.2, pre.3, pre.4, pre.5, post.1, post.2, post.3, post.4, post.5,
           fup.1, fup.2, fup.3, fup.4, fup.5) ~  treatment + gender + age, data=n.OBrienKaiser)
(av.2 <- Anova(mod.2, idata=idata, idesign=~phase*hour, type = 3))

# Type III Repeated Measures MANOVA Tests: Pillai test statistic
#                      Df test stat approx F num Df den Df       Pr(>F)
# (Intercept)           1     0.959    254.5      1     11 0.0000000059 ***
# treatment             2     0.428      4.1      2     11      0.04644 *
# gender                1     0.271      4.1      1     11      0.06832 .
# age                   1     0.226      3.2      1     11      0.10030
# phase                 1     0.792     19.0      2     10      0.00039 ***
# ...

# removing the within-subject interaction does NOT alter the lower order effects:
mod.3 <- lm(cbind(pre.1, pre.2, pre.3, pre.4, pre.5, post.1, post.2, post.3, post.4, post.5,
           fup.1, fup.2, fup.3, fup.4, fup.5) ~  treatment * gender + age, data=n.OBrienKaiser)
(av.3 <- Anova(mod.3, idata=idata, idesign=~phase+hour, type = 3))
# Type III Repeated Measures MANOVA Tests: Pillai test statistic
#                        Df test stat approx F num Df den Df      Pr(>F)
# (Intercept)             1     0.968    269.4      1      9 0.000000052 ***
# treatment               2     0.443      3.6      2      9      0.0719 .
# gender                  1     0.305      3.9      1      9      0.0782 .
# age                     1     0.054      0.5      1      9      0.4902
# treatment:gender        2     0.222      1.3      2      9      0.3232
# phase                   1     0.811     17.2      2      8      0.0013 **
# ...



Am 22.07.2012 23:25, schrieb John Fox: