Two-Way ANOVA: Calculating F-ratios and Null Hypothesis Significance Testing (NHST)

Course Announcements and Logistics

  • Exam 2: Grades will be posted after today's lecture. Exams can be viewed during office hours.

  • Exam 3: Scheduled for next Wednesday (7/29). Details and a review sheet will be provided by Friday.

  • Schedule Update: No lecture on Tuesday (7/28) to allow for study time. Additional office hours will be held from 10:00 am to 12:00 pm at Psychology 1327.

  • Lab: Lab sessions will still occur next week; students should aim to complete Assignment 6 during their section.

  • Course Evaluations: Students are requested to complete their course evaluations.

Therapy Dogs Study Background

  • Participants: 60 students total were recruited for the study.

  • Groups by Predisposition:

    • n=30n = 30 students who are afraid of dogs.

    • n=30n = 30 students who are not afraid of dogs.

  • Experimental Assignment (Random Assignment): Half of each predisposition group is assigned to one of two conditions (n=15n = 15 per cell):

    • Dog Therapy: Interacting with a dog in a room for 30 minutes.

    • No Dog Therapy: Sitting in a room for 30 minutes without a dog.

  • Measurement: Stress levels were measured after the 30-minute session on a scale of 0–100. Higher scores indicate higher levels of stress.

The Four Steps of Null Hypothesis Significance Testing (NHST)

  1. State the Hypotheses: State the null (H0H_0) and alternative (H1H_1) hypotheses. Consider whether the alternative hypothesis should be directional or non-directional.

  2. Choose Criteria: Select an alpha level (α\alpha) and determine associated critical values. Consider the consequences regarding Type I and Type II errors and the choice between one-tailed and two-tailed tests.

  3. Calculate Test Statistic: Use sample data to calculate the statistic. Understand what the resulting pp-value indicates about the sample test statistic.

  4. Make a Decision: Reject or fail to reject the null hypothesis. Results must be written in APA style, including multiple F-ratios and post-hoc tests where applicable.

Partitioning Variance in Two-Way ANOVA

  • Total Variability is divided into two primary categories:

    • Within-groups variance: Represents error or unsystematic variability. It remains the same regardless of which effect is being tested.

    • Between-groups variance: Represents systematic variability, which is further partitioned into three specific effects:

      1. Main Effect of Factor A: Fear of Dogs.

      2. Main Effect of Factor B: Therapy Participation.

      3. Interaction Effect (A×BA \times B): Fear of Dogs ×\times Therapy Participation.

  • F-Ratio Structure:

    • FFear of Dogs=MSFearMSWithinF_{\text{Fear of Dogs}} = \frac{MS_{\text{Fear}}}{MS_{\text{Within}}}

    • FTherapy=MSTherapyMSWithinF_{\text{Therapy}} = \frac{MS_{\text{Therapy}}}{MS_{\text{Within}}}

    • FInteraction=MSInteractionMSWithinF_{\text{Interaction}} = \frac{MS_{\text{Interaction}}}{MS_{\text{Within}}}

Calculating Sum of Squares (SS) and Degrees of Freedom (df)

  • Total Variability (SSTSS_T):

    • Formula: SST=(xGM)2SS_T = \sum(x - GM)^2, where GMGM is the Grand Mean.

    • dfT=N1df_T = N - 1. For this study, N=60N = 60, so dfT=59df_T = 59.

  • Within-Groups Variability (SSWSS_W):

    • This is the sum of the Sum of Squares within each individual cell.

    • Data points from the study:

      • Cell 1 SS: 4187.824187.82

      • Cell 2 SS: 2041.92041.9

      • Cell 3 SS: 2400.722400.72

      • Cell 4 SS: 3434.23434.2

    • Total SSW=4187.82+2041.9+2400.72+3434.2=12,064.64SS_W = 4187.82 + 2041.9 + 2400.72 + 3434.2 = 12,064.64.

    • dfW=Nkdf_W = N - k, where kk is the number of cells. dfW=604=56df_W = 60 - 4 = 56.

  • Between-Groups Variability (SSBSS_B):

    • Formula: SSB=SSTSSWSS_B = SS_T - SS_W.

    • Data calculation result: SSB=5,702.27SS_B = 5,702.27.

    • dfB=dfTdfW=5956=3df_B = df_T - df_W = 59 - 56 = 3.

  • Main Effect and Interaction SS Breakthrough:

    • SSFear=3,631.70SS_{\text{Fear}} = 3,631.70 with dffear=1df_{\text{fear}} = 1

    • SSTherapy=7.14SS_{\text{Therapy}} = 7.14 with dftherapy=1df_{\text{therapy}} = 1

    • SSInteraction=2,063.42SS_{\text{Interaction}} = 2,063.42 with dfinteraction=dffear×dftherapy=1×1=1df_{\text{interaction}} = df_{\text{fear}} \times df_{\text{therapy}} = 1 \times 1 = 1

Calculating Mean Squares (MS) and F-Ratios

  • Mean Square Formulas: MS=SSdfMS = \frac{SS}{df}

    • MSwithin=12,064.6456=215.44MS_{\text{within}} = \frac{12,064.64}{56} = 215.44

    • MSfear=3,631.701=3,631.70MS_{\text{fear}} = \frac{3,631.70}{1} = 3,631.70

    • MStherapy=7.141=7.14MS_{\text{therapy}} = \frac{7.14}{1} = 7.14

    • MSinteraction=2,063.421=2,063.42MS_{\text{interaction}} = \frac{2,063.42}{1} = 2,063.42

  • F-Ratio Calculations:

    • Ffear=3,631.70215.44=16.86F_{\text{fear}} = \frac{3,631.70}{215.44} = 16.86

    • Ftherapy=7.14215.44=0.03F_{\text{therapy}} = \frac{7.14}{215.44} = 0.03

    • Finteraction=2,063.42215.44=9.58F_{\text{interaction}} = \frac{2,063.42}{215.44} = 9.58

Two-Way ANOVA Summary Table

Source

SS

df

MS

F

Between Groups

5,702.275,702.27

33

Fear

3,631.703,631.70

11

3,631.703,631.70

16.8616.86

Therapy

7.147.14

11

7.147.14

0.030.03

Interaction

2,063.422,063.42

11

2,063.422,063.42

9.589.58

Within Groups (Error)

12,064.6412,064.64

5656

215.44215.44

Total

17,766.9117,766.91

5959

Significance Decisions and Critical Values

  • Alpha Level: α=.05\alpha = .05

  • Critical Value (FcritF_{crit}): With dfnumerator=1df_{\text{numerator}} = 1 and dfdenominator=56df_{\text{denominator}} = 56, the Fcrit=4.02F_{crit} = 4.02.

  • Note on Critical Values: The FcritF_{crit} is the same for all three effects in this example because the degrees of freedom for each effect (df=1df = 1) and the within-groups degrees of freedom (df=56df = 56) are identical. If the factors had different numbers of levels, the critical values would change.

  • Statistically Significant Findings:

    • Fear of Dogs: 16.86 > 4.02 (Reject H0H_0).

    • Therapy Participation: 0.03 < 4.02 (Fail to reject H0H_0; since F < 1.00, it is automatically non-significant).

    • Interaction: 9.58 > 4.02 (Reject H0H_0).

Post-Hoc Testing and Interaction Deconstruction

  • Tukey’s HSD (Honestly Significant Difference):

    • Main effects do not require Tukey's HSD if there are only two levels per factor.

    • A significant interaction requires follow-up post-hoc tests to determine where specific differences lie among the means.

    • In this sample, the HSD value was calculated as 10.61|10.61|. Group mean differences must be greater than this value to be significant at α=.05\alpha = .05.

  • Interaction Comparisons (Deconstruction):

    • Comparison 1: 48.4536.02=12.4348.45 - 36.02 = 12.43 (Significant, as 12.43 > 10.61).

    • Comparison 2: 52.2763.31=11.0452.27 - 63.31 = -11.04 (Significant, as |11.04| > 10.61).

    • Comparison 3: 48.4552.27=3.8248.45 - 52.27 = -3.82 (Not significant).

    • Comparison 4: 36.0263.31=27.2936.02 - 63.31 = -27.29 (Significant).

  • Rule of Comparison: When interpreting an interaction, always compare one level of a variable with the other level of that same factor. Do not compare diagonally. An interaction occurs when the effect of one factor depends on the level of the other factor.

Interpretation and Visualization

  • Qualifying Main Effects: A significant interaction "qualifies" a main effect. This means the main effect is present but does not tell the whole story; the results only make full sense when viewing the interaction.

  • Visualization: Interactions are easiest to interpret via line graphs. Non-parallel lines (converging, diverging, or crossing) indicate a potential interaction.

Reporting Results in APA Style

  • Example Text: "A two-way between-subjects Analysis of Variance (ANOVA) was conducted. The factors were therapy participation (i.e., whether someone had dog therapy or not) and fear of dogs (i.e., whether someone was scared of dogs or not). The dependent variable was stress level. The ANOVA revealed that there was not a significant effect for therapy participation, F(1, 56) < 1.00, but there was for fear of dogs, F(1,56)=16.86F(1, 56) = 16.86, p=.0001p = .0001. People who were afraid of dogs (M=57.79M = 57.79, SD=xxSD = xx) had higher stress levels than those who were not afraid of dogs (M=42.24M = 42.24, SD=xxSD = xx). However, this main effect was qualified by a significant interaction between fear of dogs and therapy participation, F(1,56)=9.58F(1, 56) = 9.58, p=.003p = .003."

  • Effect Size: Eta-squared (η2\eta^2) should be included for all F-ratios. Cohen’s dd should be reported for post-hoc tests.

  • Conclusion Interpretation: The effect of dog therapy depends on how afraid a person is of dogs. For those not scared of dogs, therapy significantly lowers stress. For those scared of dogs, therapy participation actually results in significantly higher stress level. Therefore, dog therapy is recommended only for those who do not fear dogs.

Insight Activities & Discussion

  • Student Prompt: Describe the steps to calculate three F-ratios for a two-way ANOVA using SS, df, and MS.

  • Follow-up Question: Why would the FcritF_{crit} be the same for all effects?

    • Answer: It is the same because the dfeffectdf_{\text{effect}} and dfwithindf_{\text{within}} are identical for all tests in this specific design (1,561, 56). This changes if factors have different numbers of levels.

  • Follow-up Question: Do we conduct Tukey’s HSD for main effects with 2 levels?

    • Answer: No, post-hoc tests are only required if a factor has more than two levels.