Ed230B/C

Interactions


Interactions Defined

  • There is an interaction when the differences between the differences are different.
  • That is, when the effects of one variable are dependent on the levels of another variable.

    Graphs of Means of Hypothetical 2x2 Factorial Designs

  • There may be main effects and no interactions.
  • There may be interactions and no main effects.
  • Or there may be any combination of both.

    No Interactions

    Interactions

    Interactions Take Precedence over Main Effects

  • Interpret interactions first.
  • Interpret main effects carefully. It can be difficult to interpret main effects in the presence of interactions.

    When Interactions are Significant

  • Plot group means.
  • Use one of the post-hoc comparisons, such as, tests of simple main effects.

    Consider this 3 Factor Example

    A       main effect  sig
    B       main effect  sig
    C       main effect   ns
    A*B     interaction   ns
    A*C     interaction   ns
    B*C     interaction  sig
    A*B*C   interaction   ns
    Or this 4 Factor Example

    A       main effect  sig
    B       main effect  sig
    C       main effect   ns
    D       main effect  sig
    A*B     interaction   ns
    A*C     interaction   ns
    A*D     interaction   ns
    B*C     interaction  sig
    B*D     interaction  sig
    C*D     interaction  sig
    A*B*C   interaction   ns
    A*B*D   interaction   ns
    B*C*D   interaction  sig
    A*B*C*D interaction   ns
    Interpreting Interactions

  • Plot of cell means.
  • Tests of simple main effects.

    Graph of Cell Means from the 3x3 Factorial Example

    Tests of Simple Main Effects

    Source             SS  df       MS       F   
    A              190.00   2    95.00    1.52   n.s.
    B             1543.33   2   771.67   12.35   sig.
    A*B           1236.67   4   309.17    4.95   sig
      B at a1       63.33   2    31.67    0.51   n.s.
      B at a2      103.33   2    51.67    0.83   n.s.
      B at a3     2613.33   2  1306.67   20.91   sig.
    Wcell         2250.00  36    62.50
    Total         5220.00  44
    

  • Note: SSB + SSA*B = 1543.33 + 1236.67 = 2780
  • And: SSB at a1 + SSB at a2 + SSB at a3 = 63.33 + 103.33 + 2613.33 = 2779.99

    Tests of Simple Main Effects in Stata

    use http://www.gseis.ucla.edu/courses/data/crf33
    
    anova y a b a*b
    
                        Number of obs =      45     R-squared     =  0.5690
                        Root MSE      = 7.90569     Adj R-squared =  0.4732
    
               Source |  Partial SS    df       MS           F     Prob > F
           -----------+----------------------------------------------------
                Model |     2970.00     8      371.25       5.94     0.0001
                      |
                    a |      190.00     2       95.00       1.52     0.2324
                    b |  1543.33333     2  771.666667      12.35     0.0001
                  a*b |  1236.66667     4  309.166667       4.95     0.0028
                      |
             Residual |     2250.00    36       62.50   
           -----------+----------------------------------------------------
                Total |     5220.00    44  118.636364 
    
    sme b a
     
    Test of b at a(1): F(2/36)  = .50666667
    Test of b at a(2): F(2/36)  = .82666667
    Test of b at a(3): F(2/36)  = 20.906667
    
    
    Critical value of F for alpha = .05 using ...
    --------------------------------------------------
    Dunn's procedure              = 4.0941238
    Marascuilo & Levin            = 4.5974255
    per family error rate         = 4.5974255
    simultaneous test procedure   = 6.5295994
    

    Follow Up with Pairwise Comparisons at a3

    fhcomp b if a==3
    
    Fisher-Hayter pairwise comparisons for variable b
    studentized range critical value(.05, 2, 36) = 2.868158
    
                                          mean     critical
    grp vs grp       group means          dif        dif
    -------------------------------------------------------
      1 vs   2    20.0000    40.0000    20.0000*  10.1405
      1 vs   3    20.0000    52.0000    32.0000*  10.1405
      2 vs   3    40.0000    52.0000    12.0000*  10.1405

    Regression using xi3

    xi3: regress y g.b@g.a
    s.b               _Ib_1-3             (naturally coded; _Ib_1 omitted)
    s.a               _Ia_1-3             (naturally coded; _Ia_1 omitted)
    s.b@s.a           _IbWa_#_#           (simple effects of b at a)
    
          Source |       SS       df       MS              Number of obs =      45
    -------------+------------------------------           F(  8,    36) =    5.94
           Model |     2970.00     8      371.25           Prob > F      =  0.0001
        Residual |     2250.00    36       62.50           R-squared     =  0.5690
    -------------+------------------------------           Adj R-squared =  0.4732
           Total |     5220.00    44  118.636364           Root MSE      =  7.9057
    
    ------------------------------------------------------------------------------
               y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           _Ia_2 |         -3   2.886751    -1.04   0.306    -8.854603    2.854603
           _Ia_3 |          2   2.886751     0.69   0.493    -3.854603    7.854603
       _IbWa_2_1 |          2          5     0.40   0.692     -8.14047    12.14047
       _IbWa_3_1 |          5          5     1.00   0.324     -5.14047    15.14047
       _IbWa_2_2 |          1          5     0.20   0.843     -9.14047    11.14047
       _IbWa_3_2 |          6          5     1.20   0.238     -4.14047    16.14047
       _IbWa_2_3 |         20          5     4.00   0.000      9.85953    30.14047
       _IbWa_3_3 |         32          5     6.40   0.000     21.85953    42.14047
           _cons |         35   1.178511    29.70   0.000     32.60987    37.39013
    ------------------------------------------------------------------------------
    
    describe _IbWa_2_1 _IbWa_3_1 _IbWa_2_2 _IbWa_3_2 _IbWa_2_3 _IbWa_3_3
    
                  storage  display     value
    variable name   type   format      label      variable label
    -------------------------------------------------------------------------------
    _IbWa_2_1       double %10.0g                 b(2 vs. 1) @ a==1
    _IbWa_3_1       double %10.0g                 b(3 vs. 1) @ a==1
    _IbWa_2_2       double %10.0g                 b(2 vs. 1) @ a==2
    _IbWa_3_2       double %10.0g                 b(3 vs. 1) @ a==2
    _IbWa_2_3       double %10.0g                 b(2 vs. 1) @ a==3
    _IbWa_3_3       double %10.0g                 b(3 vs. 1) @ a==3
    
    test _IbWa_2_1 _IbWa_3_1
    
     ( 1)  _IbWa_2_1 = 0.0
     ( 2)  _IbWa_3_1 = 0.0
    
           F(  2,    36) =    0.51
                Prob > F =    0.6067
    
    test _IbWa_2_2 _IbWa_3_2
    
     ( 1)  _IbWa_2_2 = 0.0
     ( 2)  _IbWa_3_2 = 0.0
    
           F(  2,    36) =    0.83
                Prob > F =    0.4456
    
    test _IbWa_2_3 _IbWa_3_3
    
     ( 1)  _IbWa_2_3 = 0.0
     ( 2)  _IbWa_3_3 = 0.0
    
           F(  2,    36) =   20.91
                Prob > F =    0.0000
    Consider the Following Plot of Cell Means

    Would you need to do tests of simple main effects?

    Would you need to follow up tests of simple main effects with pairwise comparisons?

    Pooling

  • When an interaction is not significant, it is possible to "pool" interaction effects into the error term.
  • In a multifactor design use the highest order interaction if it is non-significant.
  • SSpooled = SSint + SSerror
  • dfpooled = dfint + dferror
  • MSerror* = SSpooled / dfpooled
  • Recompute F-ratios for main effects using MSerror*

  • If the SSint is very small then the dfint can result in a smaller error term and thus slightly more power.

    Philosophies on Pooling

  • Always pool whenever it is allowed.
  • Never pool.
  • Pool sometimes.

    Pooling

  • The argument against is that basically the model is being changed in the middle of an analysis. ANOVA is not considered a modeling building method and therefore pooling is suspect.
  • The "pool sometimes" avocates respond that there are instances in which there is no theoretical or empirical basis for an intereaction, so in those cases it is okay to pool.
  • The "pool always" group says that you can never have too much power.

    Simplified Pooling Example

    Step 1: Without Pooling
    Source    SS    df      MS         F     
    A         45     3   15.00     1.875    p>.05
    B         72     4   18.00     2.250    p>.05
    A*B        5    12     .42       <1     n.s.
    Wcell    800   100    8.00
    Total    922   119
    
    
    Step 2: With Pooling
    Source    SS    df      MS         F     
    A         45     3   15.00      2.11    p>.05
    B         72     4   18.00      2.50    p<=.05
    Error    805   112    7.19
    Total    922   119
    

    A More Complex Example of Pooling

    Step 1: Without Pooling
    Source
    A
    B
    C
    A*B
    A*C
    B*C
    A*B*C
    Wcell
    Total

    Step 2: Pool Highest Order Interaction
    Source
    A
    B
    C
    A*B
    A*C
    B*C
    Error = Wcell + A*B*C
    Total

    Step 3: Pool All Interactions
    Source
    A
    B
    C
    Error = Wcell + A*B*C + A*B + A*C + B*C
    Total

    Pooling in Stata

    Pooling in Stata can be accomplished simply leaving the appropriate interactions terms out of the anova command.

    anova y a b c a*b a*c b*c a*b*c   /* no pooling */
    
    anova y a b c a*b a*c b*c         /* pool a*b*c */
    
    anova y a b c                     /* pool a*b a*c b*c a*b*c */


    Linear Statistical Models Course

    Phil Ender, 12Feb98