Let’s say we have two factors (A and B), each with two levels (A1, A2 and B1, B2) and a response variable (y).
The when performing a two way ANOVA of the type:
We are testing three null hypothesis:
- There is no difference in the means of factor A
- There is no difference in means of factor B
- There is no interaction between factors A and B
When written down, the first two hypothesis are easy to formulate (for 1 it is $H_0:\; \mu_=\mu_$)
But how should hypothesis 3 be formulated?
edit. and how would it be formulated for the case of more then two levels?
I think it’s important to clearly separate the hypothesis and its corresponding test. For the following, I assume a balanced, between-subjects CRF-$pq$ design (equal cell sizes, Kirk’s notation: Completely Randomized Factorial design).
$Y_$ is observation $i$ in treatment $j$ of factor $A$ and treatment $k$ of factor $B$ with $1 \leq i \leq n$, $1 \leq j \leq p$ and $1 \leq k \leq q$. The model is $Y_ = \mu_ + \epsilon_, \quad \epsilon_ \sim N(0, \sigma_^2)$
B 1 \ldots B k \ldots B q
\\\hline A 1 \mu_ \ldots \mu_ \ldots \mu_ \mu_\\ \ldots \ldots \ldots \ldots \ldots \ldots \ldots\\ A j \mu_ \ldots \mu_ \ldots \mu_ \mu_\\ \ldots \ldots \ldots \ldots \ldots \ldots \ldots\\ A p \mu_ \ldots \mu_ \ldots \mu_ \mu_\\\hline
\mu_ \ldots \mu_ \ldots \mu_ \mu \end$
$\mu_$ is the expected value in cell $jk$, $\epsilon_$ is the error associated with the measurement of person $i$ in that cell. The $()$ notation indicates that the indices $jk$ are fixed for any given person $i$ because that person is observed in only one condition.
A few definitions for the effects:
$\mu_ = \frac \sum_^ \mu_$ (average expected value for treatment $j$ of factor $A$)
$\mu_ = \frac
\sum_^
\mu_$ (average expected value for treatment $k$ of factor $B$)
$\alpha_ = \mu_ – \mu$ (effect of treatment $j$ of factor $A$, $\sum_^
\alpha_ = 0$)
$\beta_ = \mu_ – \mu$ (effect of treatment $k$ of factor $B$, $\sum_^ \beta_ = 0$)
$(\alpha \beta)_ = \mu_ – (\mu + \alpha_ + \beta_) = \mu_ – \mu_ – \mu_ + \mu$
(interaction effect for the combination of treatment $j$ of factor $A$ with treatment $k$ of factor $B$, $\sum_^
(\alpha \beta)_ = 0 \, \wedge \, \sum_^ (\alpha \beta)_ = 0)$
$\alpha_^ = \mu_ – \mu_$
(conditional main effect for treatment $j$ of factor $A$ within fixed treatment $k$ of factor $B$, $\sum_^
\alpha_^ = 0 \, \wedge \, \frac \sum_^ \alpha_^ = \alpha_ \quad \forall \, j, k)$
$\beta_^ = \mu_ – \mu_$
(conditional main effect for treatment $k$ of factor $B$ within fixed treatment $j$ of factor $A$, $\sum_^ \beta_^ = 0 \, \wedge \, \frac
\sum_^
\beta_^ = \beta_ \quad \forall \, j, k)$
With these definitions, the model can also be written as: $Y_ = \mu + \alpha_ + \beta_ + (\alpha \beta)_ + \epsilon_$
This allows us to express the null hypothesis of no interaction in several equivalent ways:
$H_>: \sum_\sum_ (\alpha \beta)^_ = 0$
(all individual interaction terms are $0$, such that $\mu_ = \mu + \alpha_ + \beta_ \, \forall j, k$.
This means that treatment effects of both factors – as defined above – are additive everywhere.)
$H_>: \alpha_^ – \alpha_^ = 0 \quad \forall \, j \, \wedge \, \forall \, k, k’; \quad (k \neq k’;)$
(all conditional main effects for any treatment $j$ of factor $A$ are the same, and therefore equal $\alpha_$. This is essentially Dason’s answer.)
$H_>: \beta_^ – \beta_^ = 0 \quad \forall \, j, j’; \, \wedge \, \forall \, k \quad (j \neq j’;)$
(all conditional main effects for any treatment $k$ of factor $B$ are the same, and therefore equal $\beta_$.)
$H_>$: In a diagramm which shows the expected values $\mu_$ with the levels of factor $A$ on the $x$-axis and the levels of factor $B$ drawn as separate lines, the $q$ different lines are parallel.
An interaction tells us that the levels of factor A have different effects based on what level of factor B you’re applying. So we can test this through a linear contrast. Let C = (A1B1 – A1B2) – (A2B1 – A2B2) where A1B1 stands for the mean of the group that received A1 and B1 and so on. So here we’re looking at A1B1 – A1B2 which is the effect that factor B is having when we’re applying A1. If there is no interaction this should be the same as the effect B is having when we apply A2: A2B1 – A2B2. If those are the same then their difference should be 0 so we could use the tests:
$H_0: C = 0\quad\text\quad H_A: C \neq 0.$
answered Dec 18 ’10 at 14:14
chl ♦
37.4k ● 6 ● 124 ● 243
Thanks Dason, that helped. Also, after reading your reply, it suddenly became clear to me that I am not fully sure how this generalizes in case we are having more factors. Could you advise? Thanks again. Tal Tal Galili Dec 18 ’10 at 14:21
You can test multiple contrasts simultaneously. So for example if A had three levels and B had 2 we could use the two contrasts: C1 = (A1B1 – A2B1) – (A2B1 – A2B2) and C2 = (A2B1 – A2B2) – (A3B1 – A3B2) and use a 2 degree of freedom test to simultaneously test if C1 = C2 = 0. It’;s also interesting to note that C2 could equally have been (A1B1 – A1B2) – (A3B1 – A3B2) and we would come up with the same thing. Dason Dec 18 ’10 at 14:23