# Number of interactions in ANOVA with 4 independent variables

I'm reading an article that states in ANOVA with 4 independent variables, there will be 4 main effects and 11 interactions. I was wondering how the number, 11 interactions, is obtained?

• All possible combinations = $2^4=16$. Subtract four main effects--and don't forget to subtract $1$ to reflect an implicit constant (such as the grand mean).
– whuber
Jan 20, 2013 at 22:50

This is a relatively simple application of combinatorical calculations. The total number of combinations is given as $2^k$ where $k$ is the number of variables in the ANOVA ($k=4$ in your case). The logic behind this is that each variable can be either included or not included in each interaction term (eg the main effects only include one variable). You also have that the number of jth order interaction terms (i.e. interactions involving $j$ of the $k$ variables) is given simply by the choose function ${k\choose j}=\frac{k!}{j!(k-j)!}$ (number of ways to select $j$ objects from $k$ objects). This also gives rise to the well known result $\sum_{j=0}^k{k\choose j}=2^k$. To get the number of interaction terms we simple sum over $j=2,\dots,k$ rather than from $j=0,\dots,k$. Alternatively we can subtract off the terms $j=0,1$ from $2^k$ which gives us $$\text{no. of interactions}=2^k-k-1$$ plugging in $k=4$ gives you $11$.

These are the possible interactions between the 4 IV's:

1x2
1x3
1x4
2x3
2x4
3x4
1x2x3
1x2x4
1x3x4
2x3x4
1x2x3x4


Which comes to a total of 11.