After using ezANOVA as my primary way of specifying mixed ANOVAs, I've hit a stumbling block when it come to adding a covariate to the model. I am using an ANCOVA in order to determine if there is a developmental trajectory in my data; namely, I need to be able to see the F-statistic and p-values for interactions with the covariate (see p.466 onwards here if you want an example).

Using ezANOVA, I can include covariates but the output does not show the F-statistic and p-values for interactions with the covariate - the main effect of the covariate is also not tested using this method.

My ezANOVA model is as follows:

      , dv=.(x)
      , wid=.(ID)
      , within=.(Texture,View)
      , between=.(TNOGroup)
      , between_covariates=.(Age)
      , type=3
      , return_aov=TRUE

Another option is to use lm or Anova, but I don't know how to specify the error terms properly for either and I'm limited because I want to use Type-III sums of squares (drop1 doesn't work in the cases where I've tried to use the aov wrapper for lm; it fails while reporting 'Error in formula.default(object, env = baseenv()) : invalid formula').

Finally, I've heard about using the nlme package to specify my ANCOVA as a mixed model instead, but I don't know where to begin here (despite spending a while reading about it).

To give a summary, I'm trying to do a 2 (between; TNOGroup) x 2 (within, Texture) x2 (within, View) mixed ANCOVA, with age as a covariate. I want to use Type-III sums of squares, and see the F-statistic and p-values for interactions with the covariate, as well as for the main effect of the covariate.

Any advice on the best way to do this would be much appreciated.

  • $\begingroup$ Welcome to the site, @luser. I can't tell if this question is only about how to get this done in R & not about any of the related statistical ideas. If so, it would be off-topic for CV (see our help page), & would probably be best sent to the r-help-listserve. If you have a substantive question about statistics, please edit to clarify, if not, this question may need to be closed. $\endgroup$ – gung - Reinstate Monica Sep 18 '13 at 16:15
  • 2
    $\begingroup$ There is a statistical problem in understanding what the specific model needed is. $\endgroup$ – John Sep 18 '13 at 16:19

Just specify Age as an additional between variable. That will give you all of the interactions. The term ANCOVA for what is described in the paper is pretty much meaningless. It's just a fully factorial ANOVA with a continuous predictor included.

Following what the references article said, if your dependent variable is accuracy you should really look at Dixon (2008) and maybe Jaeger (2008).

Dixon, P. (2008). Models of accuracy in repeated-measures design. Journal of Memory and Language, 59, 447-456.

Jaeger, F. T. (2008). Categorical data analysis: Away from ANOVAs (transformation or not) and towards logit mixed models. Journal of Memory and Language, 59, 434-446.

  • $\begingroup$ You are correct - thanks for your input. Although my DV is not strictly accuracy, those papers were still useful. $\endgroup$ – luser Sep 20 '13 at 10:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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