Solved – ANOVA vs. T-test for two groups

anovat-test

I'm conducting an exercise intervention with office workers. The intervention will include Yoga classes and one to one coaching. I will be looking at the effects of the intervention on two dependent variables: 1. walking 2. the amount of time workers spend standing.

I have a control group and a treatment group. Walking data will be measured using pedometers, and standing time will be measured using a self-report questionnaire.

Am I right in thinking that a two-way unrelated ANOVA is needed to test for difference between the groups?

Best Answer

Usually, we use ANOVA if there are more than two groups. But you also can use ANOVA with two groups, as you describe. In that case ANOVA will result in the same conclusion as an Student's t test, where $t^{2} = F$. See this R code:

# Makes example reproducible
set.seed(1)
# define sample size
n <- 100
# generate a group
group <- sample(0:1, n, replace= TRUE)
# generate a dependent variable that varies between groups
y <- rnorm(n) + group
# run a t test (variance must be assumed as being equel, otherwise the results do differ to those from ANOVA)
t.test(y ~ group, var.equal= TRUE)
# run ANOVA
summary(aov(y ~ group))
# F= 32.97
# See if t^2= F
t.test(y ~ group, var.equal= TRUE)$statistic**2
# t^2= 32.97

This is only true for the Student's t test where equal variances are assumed, while the results of a Welch t test differ to those of ANOVA. Further, since you have multiple dependent variables, maybe you want to have a look at a MANOVA, although I do not know whether this makes sense in your situation. Regardless what analysis you use you should check the assumptions.

If you do not have R you can simply put the code here.

Related Question