Announcement

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

  • Including or omitting main effects in model with interactions

    Hi all, I’m having a bit of trouble understanding a few concepts regarding the inclusion of main effects alongside interactions terms.

    My question is do I need to include main effects when I have included their interactions and if I don’t what does this mean? For instance below is the fixed effects model I am running – I have only included the variables that are time variant and I am using a panel dataset which follows the same women over two time periods:

    My outcome variable is women’s conjugal power (a score) and my main predictor variable is whether a woman has a boy-child (son) and I am interacting this variable with four other variables: wealth quintiles, education, relative education and patrilocal households.

    First I run the model where I omit my main effects (has son and wealth quintles, education, relative education and patrilocal households)

    Code:
    xtreg M1  haschildren spercent2 totalchild dualearner i.round c.age#c.age2 gdp1 o1.sondum2#o0.releduc o1.sondum2#o1.educ o1.sondum2#o1.qwealth o1.sondum2#o0.patrilocal, fe
    Code:
    Fixed-effects (within) regression               Number of obs     =      4,560
    Group variable: Findid                          Number of groups  =      2,280
    
    R-sq:                                           Obs per group:
         within  = 0.0236                                         min =          2
         between = 0.0002                                         avg =        2.0
         overall = 0.0009                                         max =          2
    
                                                    F(27,2253)        =       2.02
    corr(u_i, Xb)  = -0.2875                        Prob > F          =     0.0014
    
    --------------------------------------------------------------------------------------
                      M1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ---------------------+----------------------------------------------------------------
             haschildren |  -.2520974    .176294    -1.43   0.153     -.597813    .0936182
               spercent2 |   .2941761   .2280691     1.29   0.197    -.1530714    .7414237
              totalchild |  -.0409311   .0569732    -0.72   0.473    -.1526566    .0707943
              dualearner |   .0145703   .0913376     0.16   0.873    -.1645443    .1936849
                         |
                   round |
                   2012  |   .0758831    .124811     0.61   0.543    -.1688734    .3206396
                         |
            c.age#c.age2 |   4.09e-06   4.34e-06     0.94   0.347    -4.43e-06    .0000126
                         |
                    gdp1 |   -.005971     .00338    -1.77   0.077    -.0125992    .0006572
                         |
         sondum2#releduc |
           Has sons#W>H  |    -.07597   .1402888    -0.54   0.588    -.3510787    .1991388
           Has sons#H>W  |   .2070449   .1483036     1.40   0.163    -.0837811    .4978708
             No son#H=W  |          0  (omitted)
             No son#W>H  |   .0307854   .2061227     0.15   0.881    -.3734247    .4349956
             No son#H>W  |   .4634932   .2193291     2.11   0.035     .0333851    .8936013
                         |
            sondum2#educ |
       Has sons#Primary  |   .4615321    .178392     2.59   0.010     .1117023     .811362
     Has sons#Secondary  |   .5136993   .3702903     1.39   0.165    -.2124465    1.239845
    Has sons#University  |  -.1859308   .3569265    -0.52   0.602    -.8858699    .5140083
      No son#Illiterate  |          0  (omitted)
         No son#Primary  |   .1558035   .2367281     0.66   0.511    -.3084245    .6200314
       No son#Secondary  |   -.491498   .5254403    -0.94   0.350    -1.521896    .5388996
      No son#University  |  -.4076214   .4075595    -1.00   0.317    -1.206853    .3916099
                         |
         sondum2#qwealth |
          Has sons#Rich  |  -.0424609   .1018518    -0.42   0.677    -.2421941    .1572722
        Has sons#Middle  |  -.0459057   .1152923    -0.40   0.691    -.2719959    .1801844
          Has sons#Poor  |   .0461349   .1341339     0.34   0.731    -.2169041    .3091739
       Has sons#Poorest  |   .0354346    .164277     0.22   0.829    -.2867154    .3575846
         No son#Richest  |          0  (omitted)
            No son#Rich  |   .2831306   .1871543     1.51   0.130    -.0838822    .6501434
          No son#Middle  |  -.0802566   .1937097    -0.41   0.679    -.4601248    .2996116
            No son#Poor  |  -.0866428   .2226979    -0.39   0.697    -.5233573    .3500717
         No son#Poorest  |  -.1119703   .2927556    -0.38   0.702     -.686069    .4621285
                         |
      sondum2#patrilocal |
             Has sons#1  |  -.0587571   .1586316    -0.37   0.711    -.3698365    .2523223
               No son#0  |          0  (omitted)
               No son#1  |   .2773891   .2653202     1.05   0.296    -.2429086    .7976867
                         |
                   _cons |  -.2326615   .3308439    -0.70   0.482    -.8814521    .4161291
    ---------------------+----------------------------------------------------------------
                 sigma_u |  1.1186275
                 sigma_e |  1.3282613
                     rho |  .41495063   (fraction of variance due to u_i)
    --------------------------------------------------------------------------------------
    F test that all u_i=0: F(2279, 2253) = 1.22                  Prob > F = 0.0000
    
    .
    and then this is the model that includes my main effects and their interaction terms (Understandably so, many of the results are omitted due to collinearity)

    Code:
    xtreg M1 haschildren spercent2 hasson primary secondary university WgreaterH HgreaterW patrilocal i.qwealth totalchild dualearner i.round c.age#c.age2 gdp1 o1.sondum2#o0.releduc o1.sondum2#o1.educ o1.sondum2#o1.qwealth o1.sondum2#o0.patrilocal, fe
    Code:
    Fixed-effects (within) regression               Number of obs     =      4,560
    Group variable: Findid                          Number of groups  =      2,280
    
    R-sq:                                           Obs per group:
         within  = 0.0237                                         min =          2
         between = 0.0002                                         avg =        2.0
         overall = 0.0010                                         max =          2
    
                                                    F(28,2252)        =       1.95
    corr(u_i, Xb)  = -0.2858                        Prob > F          =     0.0021
    
    --------------------------------------------------------------------------------------
                      M1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ---------------------+----------------------------------------------------------------
             haschildren |  -.2492079   .1765717    -1.41   0.158    -.5954682    .0970524
               spercent2 |   .2726707   .2382755     1.14   0.253    -.1945919    .7399332
                  hasson |   .1299825   .4160749     0.31   0.755    -.6859478    .9459128
                 primary |   .2167467   .3067879     0.71   0.480    -.3848698    .8183632
               secondary |  -.4228871     .56959    -0.74   0.458    -1.539863    .6940891
              university |  -.3360392   .4676262    -0.72   0.472    -1.253063    .5809842
               WgreaterH |   .0370848   .2071477     0.18   0.858    -.3691356    .4433051
               HgreaterW |   .4763202   .2231824     2.13   0.033     .0386555    .9139848
              patrilocal |   .2783719    .265392     1.05   0.294    -.2420666    .7988105
                         |
                 qwealth |
                   Rich  |  -.0467512   .1027937    -0.45   0.649    -.2483314    .1548291
                 Middle  |  -.0516164   .1167552    -0.44   0.658    -.2805755    .1773427
                   Poor  |   .0390054    .136088     0.29   0.774    -.2278657    .3058764
                Poorest  |   .0275883   .1662184     0.17   0.868     -.298369    .3535456
                         |
              totalchild |  -.0440935   .0578767    -0.76   0.446    -.1575909    .0694038
              dualearner |   .0154103   .0913955     0.17   0.866    -.1638178    .1946384
                         |
                   round |
                   2012  |   .0748453   .1248802     0.60   0.549    -.1700469    .3197376
                         |
            c.age#c.age2 |   4.12e-06   4.35e-06     0.95   0.343    -4.40e-06    .0000126
                         |
                    gdp1 |  -.0059751   .0033807    -1.77   0.077    -.0126046    .0006545
                         |
         sondum2#releduc |
           Has sons#W>H  |  -.1124946   .1955466    -0.58   0.565     -.495965    .2709757
           Has sons#H>W  |  -.2733663   .2257303    -1.21   0.226    -.7160274    .1692948
             No son#H=W  |          0  (omitted)
             No son#W>H  |          0  (omitted)
             No son#H>W  |          0  (omitted)
                         |
            sondum2#educ |
       Has sons#Primary  |   .2273548   .3295539     0.69   0.490    -.4189062    .8736159
     Has sons#Secondary  |   .9161934   .6322402     1.45   0.147    -.3236409    2.156028
    Has sons#University  |   .1289173   .3905026     0.33   0.741    -.6368654    .8946999
      No son#Illiterate  |          0  (omitted)
         No son#Primary  |          0  (omitted)
       No son#Secondary  |          0  (omitted)
      No son#University  |          0  (omitted)
                         |
         sondum2#qwealth |
         No son#Richest  |          0  (omitted)
            No son#Rich  |   .3484459   .2170782     1.61   0.109    -.0772483    .7741401
          No son#Middle  |  -.0045688   .2282547    -0.02   0.984    -.4521802    .4430427
            No son#Poor  |  -.0997328   .2582418    -0.39   0.699    -.6061495     .406684
         No son#Poorest  |  -.1056691    .333686    -0.32   0.752    -.7600333     .548695
                         |
      sondum2#patrilocal |
             Has sons#1  |  -.3380668   .2816849    -1.20   0.230    -.8904559    .2143223
               No son#0  |          0  (omitted)
               No son#1  |          0  (omitted)
                         |
                   _cons |  -.3201305   .4334688    -0.74   0.460    -1.170171    .5299097
    ---------------------+----------------------------------------------------------------
                 sigma_u |  1.1179643
                 sigma_e |  1.3285274
                     rho |   .4145655   (fraction of variance due to u_i)
    --------------------------------------------------------------------------------------
    F test that all u_i=0: F(2279, 2252) = 1.22                  Prob > F = 0.0000
    
    .
    .
    .
    In a third model that I run, as I am interested in plotting the interaction between having a boy-child and wealth quintiles I do not include any main effect and I change the notation for the interaction (i.sondum2#i.qwealth) yielding the following result:


    Code:
    Fixed-effects (within) regression               Number of obs     =      4,560
    Group variable: Findid                          Number of groups  =      2,280
    
    R-sq:                                           Obs per group:
         within  = 0.0237                                         min =          2
         between = 0.0002                                         avg =        2.0
         overall = 0.0010                                         max =          2
    
                                                    F(28,2252)        =       1.95
    corr(u_i, Xb)  = -0.2858                        Prob > F          =     0.0021
    
    --------------------------------------------------------------------------------------
                      M1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ---------------------+----------------------------------------------------------------
             haschildren |  -.2492079   .1765717    -1.41   0.158    -.5954682    .0970524
               spercent2 |   .2726707   .2382755     1.14   0.253    -.1945919    .7399332
              totalchild |  -.0440935   .0578767    -0.76   0.446    -.1575909    .0694038
              dualearner |   .0154103   .0913955     0.17   0.866    -.1638178    .1946384
                         |
                   round |
                   2012  |   .0748453   .1248802     0.60   0.549    -.1700469    .3197376
                         |
            c.age#c.age2 |   4.12e-06   4.35e-06     0.95   0.343    -4.40e-06    .0000126
                         |
                    gdp1 |  -.0059751   .0033807    -1.77   0.077    -.0126046    .0006545
                         |
         sondum2#releduc |
           Has sons#W>H  |  -.0754099   .1403283    -0.54   0.591    -.3505962    .1997765
           Has sons#H>W  |   .2029539   .1489102     1.36   0.173    -.0890618    .4949695
             No son#H=W  |          0  (omitted)
             No son#W>H  |   .0370848   .2071477     0.18   0.858    -.3691356    .4433051
             No son#H>W  |   .4763202   .2231824     2.13   0.033     .0386555    .9139848
                         |
            sondum2#educ |
       Has sons#Primary  |   .4441015   .1869481     2.38   0.018      .077493    .8107101
     Has sons#Secondary  |   .4933063   .3760733     1.31   0.190    -.2441803    1.230793
    Has sons#University  |  -.2071219   .3633853    -0.57   0.569     -.919727    .5054831
      No son#Illiterate  |          0  (omitted)
         No son#Primary  |   .2167467   .3067879     0.71   0.480    -.3848698    .8183632
       No son#Secondary  |  -.4228871     .56959    -0.74   0.458    -1.539863    .6940891
      No son#University  |  -.3360392   .4676262    -0.72   0.472    -1.253063    .5809842
                         |
         sondum2#qwealth |
          Has sons#Rich  |  -.0467512   .1027937    -0.45   0.649    -.2483314    .1548291
        Has sons#Middle  |  -.0516164   .1167552    -0.44   0.658    -.2805755    .1773427
          Has sons#Poor  |   .0390054    .136088     0.29   0.774    -.2278657    .3058764
       Has sons#Poorest  |   .0275883   .1662184     0.17   0.868     -.298369    .3535456
         No son#Richest  |  -.1299825   .4160749    -0.31   0.755    -.9459128    .6859478
            No son#Rich  |   .1717123   .4027911     0.43   0.670    -.6181683    .9615928
          No son#Middle  |  -.1861676   .3904797    -0.48   0.634    -.9519054    .5795701
            No son#Poor  |  -.1907099    .400728    -0.48   0.634    -.9765446    .5951248
         No son#Poorest  |  -.2080633   .4246817    -0.49   0.624    -1.040872    .6247451
                         |
      sondum2#patrilocal |
             Has sons#1  |  -.0596949   .1586918    -0.38   0.707    -.3708924    .2515026
               No son#0  |          0  (omitted)
               No son#1  |   .2783719    .265392     1.05   0.294    -.2420666    .7988105
                         |
                   _cons |   -.190148   .3578002    -0.53   0.595    -.8918005    .5115045
    ---------------------+----------------------------------------------------------------
                 sigma_u |  1.1179643
                 sigma_e |  1.3285274
                     rho |   .4145655   (fraction of variance due to u_i)
    --------------------------------------------------------------------------------------
    F test that all u_i=0: F(2279, 2252) = 1.22                  Prob > F = 0.0000
    
    .

    I can’t quite grasp the difference between these models and if it affects their interpretation (of the interaction terms and the main effects). I’ve been reading up using several sources such as (https://stats.idre.ucla.edu/stata/fa...n-interaction/ ) But I can’t seem to understand the difference or apply it to my particular dataset.

    Any help is appreciated.



  • #2
    in general, inclusion of the "main" effects when you have an interaction makes the interpretation much simpler; you might want to read: Nelder, JA (1998), "The selection of terms in response-surface models - how strong is the weak heredity principle?" The American Statistician, 52(4): 315-318

    Comment


    • #3
      Sherine,
      from a different corner, please note tha your within R-sq (the R-sq we should look at with -xtreg,fe-) is pretty negligibe. Different predictors are worth considering, as most of your interactions show no evidence of an effect. Moreover, if -fe- specifcation is the way to go, why excluding time-invariant predictors if they are part of the data generating process?
      Kind regards,
      Carlo
      (Stata 18.0 SE)

      Comment


      • #4
        Thank you Rich and Carlo for your response.

        Carlo,

        Yes I've made a note of this, however, the reason I've excluded the time invariant variables is because (based on my understanding) fixed effects removes the effect of time-invariant characteristics so we that we can assess the net effect of the predictors on the outcome variable?

        Comment


        • #5
          Sherine:
          your take seems to forget that -fe- specification, while cancelling out time-invariant predictors, wipe out the risk of omitted variable bias/endogeneity rlelated to time-invariant predictors, regradless they are observed or not (which is a good thing).
          You do not say anithing about the -hausman- test outcome, so I cannot say whether -re- specification (that, as you know, gives back coefficiant for time-invariant predictor, too) is the way to go.
          Kind regards,
          Carlo
          (Stata 18.0 SE)

          Comment


          • #6
            Thanks again Carlo -
            Unfortunately after running the hausman test I end up rejecting the null (suggesting that fe is the way to go over re specification) - I may have to start looking at other alternative methods, possibly modeling using change scores

            Comment


            • #7
              Sherine:
              why can't you just accept the -hausman-outcome and go -fe-?
              If you have enough within-panel variation for time non-varying predictors, results can be informative, even if you have to sacrifice coefficient estimates for time-invariant predictors.
              Kind regards,
              Carlo
              (Stata 18.0 SE)

              Comment


              • #8
                Carlo do you mean 're' as I have opted to go for fixed effects 'fe'?

                Comment


                • #9
                  Sherine:
                  no, I meant -fe- as -hausman- test outcome rejected the null.
                  Kind regards,
                  Carlo
                  (Stata 18.0 SE)

                  Comment


                  • #10
                    Yes I get what you mean now Carlo. Thank you for taking the time to explain!

                    Comment

                    Working...
                    X