13.2: Conducting a Two Factor ANOVA
- Page ID
- 49003
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Conducting a Two Factor ANOVA
Before we begin the process of calculating a 2-Factor ANOVA we need to review several key elements of the study:
- Factors: the independent variables/predictors
- Levels of each factor: how many conditions/groups/treatments a factor has
- Response variable: this is the dependent variable/outcome variable/measurement taken
- Total number of condition in the experiment: this is identified by multiplying out the number of levels for each factor
- Number of subjects per condition, n: how many participants are in each level/group/treatment
- Total number of experiment participants, N: this will be determined by type of factor for each. In a between-group design, there will be four different conditions of participants. In a complete repeated measures design, all participants are in all conditions. In mixed design, it will vary by the study design for each factor. For this chapter, we are focused on a between subjects design.
Remember that in experiments that are designed to test for a cause and effect relationship between two variables (experimental designs) the factor is the variable hypothesized to cause something to happen. The response variable is the variable we believe will be affected (changed) by the factor.
Level of each factor refers to the categories of a factor represented in the experiment. In our example of age and gender the number of levels was 2 x 2 – we refer to design by its levels (can also call them conditions/groups/treatments).
Age |
Gender |
|
Teen Males |
Teen Females |
|
Older Males |
Older Females |
Our example from Table 1 was a 2 x 2 design because there were two levels of the age variable (i.e., younger and older) and two levels of gender (i.e., male and female).
In a factorial design like the 2-Factor ANOVA, the number of subjects per condition is denoted by n and the total number of experiment participants is denoted by N. For example, if each condition has 10 participants, then n = 10. The experiment would have N = 40. In other words, 4 conditions with 10 participations (n = 10) (4 x 10) = 40 participants in the study.
Hypothesis Testing
We use the same steps for 2- Factor ANOVA that we have used for all other test statistics.
Write the alternative and null hypotheses
- 3 separate set of hypotheses: one set for each F
- A effect (factor 1)
- B effect (factor 2)
- Interaction (A x B or factor 1 x 2)
These are three separate ANOVA tests yielding 3 Fs that are independent and the results are unrelated to the outcome for either of the other two. The hypotheses are set up in the same way as chapter 12. We will see an example for an interaction later in the chapter.
Set criteria for decision making
There are three hypotheses and three F scores so there will be three critical boundaries. The critical boundary of F comes from the F distribution table.
We need to know:
-
- Alpha (α)
- degrees of freedom Factor A = dfA = (kA -1) where kA is number of levels
- degrees of freedom Factor B = dfB = (kB -1) where kB is number of levels
- degrees of freedom Interaction (A x B) = dfA*B = kA * kB
- degrees of freedom for within treatment = dftotal – (dfA + dfB + dfA*B) [within treatment is also called error]
- degrees of freedom total = dftotal = N – 1 where N is the total number of scores
Note: We would still use the critical value ANOVA table for the critical F-values. The critical values may not be the same for each hypothesis; it will depend on the number of rows and columns used in the study! We will see this in an example later in the chapter.
Sample data are collected and analyzed by performing statistics (calculations for our adjusted step 3)
In the first stage of calculations Sum of Squares (SS) Total is calculated and then separated into the two components SS Between Treatments and SS Within Treatments.
In the second stage the SS Between Treatments is separated into the three factors: Factor A, Factor B & Factor A X B (interaction factor)
Source |
SS |
df |
MS |
F |
Between Treatment (b/t) |
SSA + SSB+SSA*B |
(kA -1)+ (kB -1) |
SSb/t/dfb/t |
|
Factor A |
(identify from info. given) |
(kA -1) |
SSA / dfA |
MSA / MSw/i |
Factor B |
(identify from info. given) |
(kB -1) |
SSB / dfB |
MSB / MSw/i |
Interaction |
(identify from info. given) |
(kA)(kB -1) |
SSA*B / dfA*B |
MSA*B / MSw/i |
Within Treatment (w/i) |
SStotal – SSb/t |
dftotal – df b/t or N – dfb/t |
SSw/i / dfw/i |
|
Total |
SSBetween+SSwithin |
N – 1 |
Table 2. ANOVA summary table with calculations
Note: In real life, we would run this through a statistical program with the raw data to calculate the Fs! We are focusing conceptually on calculating the 3 Fs for a two-way factorial ANOVA. Notice that in Table 2, the Sum of Squares Between is adding up the Sum of Squares from each of the factors. You also see that to get to our F-ratios, we need the Mean Squares (just like chapter 14). We have an F for each: Factor A, Factor B and the Interaction Factor. The calculations for Sum of Square for the factors can be found be knowing the df and MS, or knowing the Sum of Squares Between.
You would also be most likely given the means and standard deviations for the 4 study conditions. Here is an example from Table 1 (made up data). You will see the main value as the mean and the standard deviation in parentheses.
Age |
Gender |
|
Teen Males M = 3.5 (.3) |
Teen Females M = 4.5 (.25) |
|
Older Males M = 8 (.5) |
Older Females M = 12.5 (.8) |
Table 2. Means and Standard Deviations example from Table 1 study design.
Make your decision and explain the results (adjusted step 4).
- When making a statistical decision you should begin by looking for patterns in the means from each of the total conditions rather than focusing on the main effects or the interaction. After identifying patterns begin interpreting with the interaction effects first.
- Interaction means that the effect of one factor depends on the level of a second factor – so then there is no consistent main effect. If you get a significant interaction, emphasize that finding over any significant main effects. In other words, if there is an interaction effect, then the main effect cannot be discussed without a qualifier.
Calculate effect size
- Effect size is calculated for each F that is statistically significant.
- Effect size reported is typically eta-square. Remember that from chapter 12, eta-square is the percentage of total variance explained variance by the factor. Again, just as you have a F for factor A, a F for factor B, and an F for the interaction, you would have eta-squares for each.