Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8366997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:03:10+00:00 2026-06-09T13:03:10+00:00

I would like to run an ANCOVA using car::Anova but cannot find out if

  • 0

I would like to run an ANCOVA using car::Anova but cannot find out if there is a way to add a covariate only as a main effect (i.e., should not interact with anything).

As far as I understand ANCOVA, covariates are just another main effect added to the model (i.e., one more effect), thereby controlling for the overall additive influence of this covariate. Followingly, the covariate(s) do not interact with the other factors. However, I cannot add a variable to Anova that does not interact with the within-subject factors (i.e., my final model does not seem to ba an ANCOVA).

Let me illustrate my problem with an example from ?Anova. The OBrienKaiser data set has 2 between (treatment and gender) and 2 within (phase and hour) factors. Now lets assume we also recorded the age of the participants and would like to add it as a covariate to the any analysis.

require(car)
set.seed(1)

n.OBrienKaiser <- within(OBrienKaiser, age <- sample(18:35, size = 16, replace = TRUE))

# the next part is taken from ?Anova
# I only modified the mod.ok <- ... call by adding + age
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)

mod.ok <- 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.ok <- Anova(mod.ok, idata=idata, idesign=~phase*hour, type = 3)) 

As the results show, the results contain interaction with the covariate age, namely of the within-subject (or repeated-measures) factors phase, hour and their interaction phase:hour:

Type III Repeated Measures MANOVA Tests: Pillai test statistic
                            Df test stat approx F num Df den Df Pr(>F)  
(Intercept)                  1     0.129     1.33      1      9  0.278  
treatment                    2     0.443     3.58      2      9  0.072 .
gender                       1     0.305     3.95      1      9  0.078 .
age                          1     0.054     0.52      1      9  0.490  
treatment:gender             2     0.222     1.28      2      9  0.323  
phase                        1     0.418     2.87      2      8  0.115  
treatment:phase              2     0.871     3.47      4     18  0.029 *
gender:phase                 1     0.084     0.37      2      8  0.703  
age:phase                    1     0.393     2.59      2      8  0.136  
treatment:gender:phase       2     0.545     1.69      4     18  0.197  
hour                         1     0.565     1.95      4      6  0.222  
treatment:hour               2     0.580     0.72      8     14  0.676  
gender:hour                  1     0.310     0.68      4      6  0.633  
age:hour                     1     0.508     1.55      4      6  0.301  
treatment:gender:hour        2     0.707     0.96      8     14  0.504  
phase:hour                   1     0.975     9.56      8      2  0.098 .
treatment:phase:hour         2     1.145     0.50     16      6  0.873  
gender:phase:hour            1     0.693     0.56      8      2  0.770  
age:phase:hour               1     0.974     9.40      8      2  0.100 .
treatment:gender:phase:hour  2     1.314     0.72     16      6  0.723  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

My question is: Can one run a ANCOVA with car::Anova and if so is there a way to specify this ANCOVA without any interaction of age?


Update (July 22, 2012): I asked this question on R-help, but so far no responses. If there are news, I will post it here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:03:11+00:00Added an answer on June 9, 2026 at 1:03 pm

    I asked this question on R-help which started a helpful discussion with John Fox (later joined by Peter Dalgaard). Unfortunately it got split up into two threads: one, two.

    The punchline is:
    “The within-subjects contrasts are constructed by Anova() to be orthogonal in the row-basis of the design, so you should be able to safely ignore the effects in which (for some reason that escapes me) you are uninterested.” (John Fox)

    So the answer to the question is: No one can’t, but it doesn’t matter because these interactions do not alter the other effects as they are orthogonal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to run git reset *.foo but this errors out. I think
I would like to run APIDemos under platforms\android-1.5\samples directory on Android emulator but I
I would like to run a python function using the command line in Eclipse
I would like to run some command (e.g. command ) using perl's system() .
I would like to run a function whenever a user's session is destroyed/times out.
I would like to run a find and replace on an HTML file through
I would like to run a main method using Maven's exec command. I can
I would like to run a Django project on a server using virtualenv in
I would like to run my Objective-C code inside Xcode, but not for the
I've got some heavyweight process, which does some video processing. I would like run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.