Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Significance of an interaction term

    Dear all,

    I have a model in which I include an interaction term between two categorical variables - one has 2 categories and the other has 3 categories (6 "combinations" overall).
    The results I got for the interaction term showed two estimations, for two combinations of the interaction. The other 4 combinations are set at base value.
    My question is this - how do I know what is the coefficient and significance of the interaction term as a whole? In papers I read, they showed only one result for the interaction and did not divide it into its combinations.
    I hope I'm clear enough.

    Thanks!
    Eran


  • #2
    Given your data there are two interaction terms. That is that. You cannot turn that into one coefficient.

    You can do a test that both interaction terms are equal to 0. Without a one number summery of "size" that is very dangerous. So only do that if you know what you are doing (and if you know what you are doing, then you probably don't want to do this...)
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thanks Maarten Buis!

      I think I'm missing something - I isert just one interaction term, i.e.:

      Code:
      Var_a##Var_b
      So why do I have two interactions?

      Thanks again!
      Eran

      Comment


      • #4
        If you include an interaction term with factor variables, than by default Stata will assume that the variables are categorical. In this case that is exactly what you want. If Var_a in your example has 3 categories, then Var_a stands for two indicator (dummy) variables. Similarly, if Var_b has two categories, then Var_b stands for 1 indicator variable. In that case Var_a##Var_b is shorthand for two main effects for Var_a, one main effect for Var_b, and two interaction terms. This is not a problem. If you would have gotten one interaction term, then that would be a problem. So don't force any changes.

        Consider the example below. Here we "explain" hourly wage with the type of place of residence and whether or not the respondent has a college degree. The main effects are the effects of that variable when the other variable(s) in the interaction is (are) zero. So The effect of having a college degree is the effect of college degree when someone lives in a rural area (both suburban and central city are zero). In our model there are two other effects of college degree, namely the effect of college degree when someone lives in a suburban area and the effect of college degree when someone lives in the central city. Hence, there are two interaction effects not one. If you live in suburbia then the effect of a college degree increases by 47 cents, i.e. if you have a college degree in suburbia then you earn on average 2.62 + 0.47 = 3.09 dollars per hour more than someone in suburbia without a college degree. If you live in a central city then the effect of college degree increases by 1.86 dollars, i.e. if you live in a central city and you have a college degree then you would earn on average 2.62+1.86 = 4.48 dollars per hour more than someone without a college degree. You can see now that one interaction term would not make sense.

        Code:
        . // open example data and do some preparations
        . sysuse nlsw88, clear
        (NLSW, 1988 extract)
        
        .
        . gen byte urban = c_city + smsa
        
        . label define urban 2 "central city" ///
        >                    1 "suburban"     ///
        >                    0 "rural"
        
        . label value urban urban
        
        . label variable urban "urbanicity"
        
        .
        . // estimate the model
        . reg wage i.collgrad##i.urban, base
        
              Source |       SS           df       MS      Number of obs   =     2,246
        -------------+----------------------------------   F(5, 2240)      =     48.99
               Model |  7330.96363         5  1466.19273   Prob > F        =    0.0000
            Residual |  67037.0038     2,240  29.9272338   R-squared       =    0.0986
        -------------+----------------------------------   Adj R-squared   =    0.0966
               Total |  74367.9674     2,245  33.1260434   Root MSE        =    5.4706
        
        --------------------------------------------------------------------------------------------
                              wage | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        ---------------------------+----------------------------------------------------------------
                          collgrad |
                 Not college grad  |          0  (base)
                     College grad  |   2.615814   .5609367     4.66   0.000     1.515804    3.715824
                                   |
                             urban |
                            rural  |          0  (base)
                         suburban  |   2.072867   .3124071     6.64   0.000      1.46023    2.685505
                     central city  |   1.163995   .3434428     3.39   0.001     .4904961    1.837495
                                   |
                    collgrad#urban |
            College grad#suburban  |   .4694946   .6973364     0.67   0.501    -.8979986    1.836988
        College grad#central city  |    1.85501   .7354167     2.52   0.012     .4128403    3.297179
                                   |
                             _cons |   5.752604   .2332663    24.66   0.000     5.295163    6.210045
        --------------------------------------------------------------------------------------------
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Thanks Maarten Buis. This helps a lot.

          Eran

          Comment


          • #6
            Hi Eran Itskovich. Add the following -contrast- command to Maarten's example to get an overall test of the interaction.

            Code:
            // Get F-test for the interaction via -contrast-
            contrast i.collgrad#i.urban
            // Confirm result via hierarchical approach using -nestreg-
            // NOTE that -nestreg- did not work with factor variable notation in earlier versions of Stata!
            nestreg: regress wage (i.collgrad i.urban) (i.collgrad#i.urban), base noheader
            Output:

            Code:
            . // Get F-test for the interaction via -contrast-
            . contrast i.collgrad#i.urban
            
            Contrasts of marginal linear predictions
            
            Margins: asbalanced
            
            --------------------------------------------------
                           |         df           F        P>F
            ---------------+----------------------------------
            collgrad#urban |          2        3.79     0.0226
                           |
               Denominator |       2240
            --------------------------------------------------
            
            . // Confirm result via hierarchical approach using -nestreg-
            . nestreg: regress wage (i.collgrad i.urban) (i.collgrad#i.urban), base noheader
            note: 0.collgrad omitted because of estimability.
            note: 0.urban omitted because of estimability.
            note: 0.collgrad#0.urban omitted because of estimability.
            note: 0.collgrad#1.urban omitted because of estimability.
            note: 0.collgrad#2.urban omitted because of estimability.
            note: 1.collgrad#0.urban omitted because of estimability.
            
            Block 1: 1.collgrad 1.urban 2.urban
            -------------------------------------------------------------------------------
                     wage | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
            --------------+----------------------------------------------------------------
                 collgrad |
            College grad  |    3.43042   .2732566    12.55   0.000     2.894558    3.966282
                          |
                    urban |
                suburban  |   2.126902   .2792441     7.62   0.000     1.579298    2.674506
            central city  |   1.597133   .3029695     5.27   0.000     1.003003    2.191263
                          |
                    _cons |   5.611732   .2175972    25.79   0.000     5.185019    6.038445
            -------------------------------------------------------------------------------
            
            Block 2: 1.collgrad#1.urban 1.collgrad#2.urban
            --------------------------------------------------------------------------------------------
                                  wage | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
            ---------------------------+----------------------------------------------------------------
                              collgrad |
                         College grad  |   2.615814   .5609367     4.66   0.000     1.515804    3.715824
                                       |
                                 urban |
                             suburban  |   2.072867   .3124071     6.64   0.000      1.46023    2.685505
                         central city  |   1.163995   .3434428     3.39   0.001     .4904961    1.837495
                                       |
                        collgrad#urban |
                College grad#suburban  |   .4694946   .6973364     0.67   0.501    -.8979986    1.836988
            College grad#central city  |    1.85501   .7354167     2.52   0.012     .4128403    3.297179
                                       |
                                 _cons |   5.752604   .2332663    24.66   0.000     5.295163    6.210045
            --------------------------------------------------------------------------------------------
            
            
              +-------------------------------------------------------------+
              |       |          Block  Residual                     Change |
              | Block |       F     df        df   Pr > F       R2    in R2 |
              |-------+-----------------------------------------------------|
              |     1 |   78.93      3      2242   0.0000   0.0955          |
              |     2 |    3.79      2      2240   0.0226   0.0986   0.0031 |
              +-------------------------------------------------------------+
            --
            Bruce Weaver
            Email: [email protected]
            Version: Stata/MP 18.5 (Windows)

            Comment


            • #7
              Thanks Bruce Weaver!

              Comment

              Working...
              X