3
$\begingroup$

I am trying to check the assumptions of a two-way ANCOVA. So in my model I have

  • two factors (F1, F2)
  • one dummy coded two level covariate (C)
  • one dependent variable (D)

In order to check the assumption of homogeneity of regression slopes I tried to perform an ANOVA with type 3 sums for the model D ~ F1*F2*C to see whether any interactions with the covariate might be significant. Using the Anova function from the car package this corresponds to

modd<-aov(D~F1*F2*C)
Anova(modd,type=3)

However, I encounter the following Error message:

Error in Anova.III.lm(mod, error, singular.ok = singular.ok, ...) : 
 there are aliased coefficients in the model

My question is, whether it makes sense for the homogeneity test to force R to compute the ANOVA anyway by supplying the singular.ok=T option or what else I should do in order to check the assumption.

$\endgroup$

1 Answer 1

6
$\begingroup$

Since C is a dummy variable with 2 levels, it really is like a factor, and your data is then a 3-factor experiment. Since there is singularity, it means that some of the cells (combinations of F1, F2, and C) are not represented in the data. Use the table function to find out which combinations have zero frequency, and maybe that can help you decide what might be a simpler model. And/or look at coef(modd) and see which coefficients are NA, corresponding to predictors that were thrown out.

Thinking about C as a covariate rather than a factor may just be adding confusion.

$\endgroup$
1
  • $\begingroup$ Thank you very much for your answer - I do now use a combination of the functions coef and drop1 in order to identify which interactions can be savely omitted before computing the ANOVA - this works in most instances except for some cases, where drop1 leads to NA results for the F- and p values, which probably means that there are not enough data points for the covariate. $\endgroup$
    – KM2W
    Commented Jul 25, 2014 at 8:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.