0

I am performing a factorial ANCOVA in R using aov_ez from the afex package. I have two binary covariates both coded as factors and dummies (0 and 1). There is no missing data in the dataset or in the covariate columns.

However, when I run aov_ez it works fine with one of the covariates, with the following model:

model<-aov_ez("ID","SCORE",data = ALL,between = c("CULTURE","COHORT"), within = c("CONSTRUAL","CONDITION"),covariate = c("SCS"),factorize = F)

But for the other (see below) I get the following error message: Error: Empty cells in between-subjects design (i.e., bad data structure).

model<-aov_ez("ID","SCORE",data = ALL,between = c("CULTURE","COHORT"), within = c("CONSTRUAL","CONDITION"),covariate = c("FOREIGN.P"),factorize = F)

How can this be? Again, I'm certain that the covariate FOREIGN.P is factors with two levels and that there is no missing data points.

  • That's odd, I get this error: `Error in as.data.frame(data) : object 'ALL' not found` – Edward Mar 29 '20 at 12:13
  • The data is confident, so I can't put it here to replicate the code. So my question is quite conceptual about whether anyone have experience about this error, as I find it rather odd that the exact same code works fine for one covariate and not another despite the fact that they look alike (both have no missing values, are binary with 0s and 1s and are coded as factors.) – EvaSahlholdt Mar 30 '20 at 08:52
  • Looks can be deceiving. ... they can't be exactly alike, and we have no way of knowing. – Edward Mar 30 '20 at 09:02
  • Do a tabulation between those three variables. You'll probably see some zero cell counts. – Edward Mar 30 '20 at 09:07

0 Answers0