February 21, 2018 at 13:56 GMT+0000 #206
So I’m having this error:
Error in aov_car(value ~ treatment * sex + age + smoker + BMI + Error(ID/treatment), : Some parameters are not estimable, most likely due to empty cells of the design (i.e., structural missings). Check your data.
Losing the BMI variable fixes it, but I would rather keep it (makes sense to adjust for it). There are no NAs in my data, BMI is of type numeric. I tried adding
na.rm = TRUEbut it did nothing. The data is not balanced (not the same number of women and men, smokers and non-smokers, but same number of treatment A and treatment B). This is complete within design, so each participant took part in two conditions. Data has one observation per row (total of 2*n rows).
Anything else I can try, besides dropping BMI?
February 21, 2018 at 17:24 GMT+0000 #207henrikKeymaster
Short answer: You have to set
factorize = FALSE.
afex‘s default behavior is to assume that the user wants an ANOVA and so transforms all variables to factors. This is what likely happens in your case. To turn this off, use the
The help page (
?aov_car) further specifies:
To run an ANCOVA you need to set
factorize = FALSEand make sure that all variables have the correct type (i.e., factors are factors and numeric variables are numeric and centered).
This is most likely what you want to do.
February 22, 2018 at 10:38 GMT+0000 #208
That did it Henrik, thanks!
Additionally, I’m having issues running emmeans():
Error in X[ii, ii, drop = FALSE] %*% y[ii] : non-conformable arguments. Running without
factorize = FALSEmakes no difference, so I guess it has nothing to do with that. emmeans works fine with lmer output, as a control.
A bit off-topic, but I forgot to center my variables. Now I did and the p-values for treatment changed by a lot. Wasn’t that not suppose to happen? Or is this normal for sum.contrasts?
February 22, 2018 at 17:40 GMT+0000 #209
Forgot to add that aov_car did not warn me about centering if the covariates are not centered.
- You must be logged in to reply to this topic.