This is an R-stats question. I have data from many subjects. My dependent variable is some blood-measure, let's say white blood count (cont variable). bc = 5.6 My independent variable of interest is group,Dx, (3 levels: controls, depressed, remitted). I want to "correct" for (add covariates), for age (cont) and gender (binary).
This gives me the formula:
myform_aov <- as.formula(sprintf("%s ~ %s + %s + %s", current_bc, "age","gender", "Dx"))
If I feed this formula into
anova <- summary(aov(myform_aov, data = data))
and
res.ancova <- data %>% anova_test(myform_aov)
I get (slightly) different results. Why is this, and which one is more correct to use?
What is the difference between summary(aov()) and anova_test(())?
aov: Dx,p-val: 0.2377 age,p-val: 0.018 gender,p-val: 0.04
anova_test: Dx,p-val: 0.238 age, p-val: 0.014 gender, p-val: 0.06