Announcement

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

  • Intercept and slope dummies for regions in a negative binomial regression

    Dear all,

    I am including intercept and slope dummies for 5 regions in a negative binomial model as follows:

    Code:
    nbreg DV IV Controls Region1 Region1*IV  Region2 Region2*IV Region3 Region3*IV Region4 Region4*IV i.country i.year, vce (cluster country)
    where DV= dependent variable, IV= key explanatory variable, Controls= control variables, Region1 and Region1*IV are intercept and slope dummies of the first region until fourth. i.country and i.year are included as country and year fixed effects.

    Given this background, I have two questions:

    First, Is it okay to include all the intercept and slope dummies for regions in one model or should I include one region at a time?

    Second, how should I interpret and the sign and significance on the coefficient on IV? Will it remain the same as the model where regional dummies were not included?

    Best regards,
    Imran Khan.



  • #2
    First,
    Code:
    nbreg DV IV Controls Region1 Region1*IV Region2 Region2*IV Region3 Region3*IV Region4 Region4*IV i.country i.year, vce (cluster country)
    is not legal Stata code for any such model because you can't use the * character here.

    Second, instead of calculating separate indicators ("dummies") for each region, just have a single variable Region taking on values 1 through 5 and use factor variable notation. Thus:

    Code:
    nbreg DV i.Region##IV Controls i.country i.year, vce(cluster country)
    Note: If IV is a continuous variable, then specify it as c.IV in the -nbreg- command.

    Second, how should I interpret and the sign and significance on the coefficient on IV? Will it remain the same as the model where regional dummies were not included?
    No, it will not be the same as in a model where there are no region indicators. It is interpreted as the slope of the (log) DV:IV relationship in the region that Stata omits as the reference level of the Region variable only.

    Interaction models are best interpreted using the -margins- command. Learning -margins- is complicated, but, fortunately, the excellent Richard Williams has written an extremely lucid presentation of it in
    https://www3.nd.edu/~rwilliam/stats/Margins01.pdf, which also includes several worked examples. Your time invested in reading it will be amply repaid. He does not, if I recall, include any examples with -nbreg-, but the principles and approach are exactly the same.

    Comment


    • #3
      Dear Clyde,

      Many thanks for your detailed reply.

      I have understood it now and I have identified the mistake in my command.

      I run the command suggested by you and have got the desired results. However, when I am calculating the marginal effects, dy/dx turned out to be missing and Std.Err. are "non-estimableā€ for regions.

      I used the following codes:
      Code:
      nbreg DV i.Region##IV Controls i.country i.year, vce(cluster country)
      eststo margin1: margins, dydx (*) atmeans post
      estimates store m1, title (Model 1)
      Best regards,
      Imran Khan.

      Comment


      • #4
        Add the -noestimchk- option to your -margins- command. But I would also suggest you post the -nbreg- output as well (as it comes directly from -nbreg-). It isn't clear to me why these margins should turn up as "not estimable." Also, after your -nbreg- command you should run -tab Region IV if e(sample)- and verify that all of the possible combinations occur in the estimation sample.

        Comment


        • #5
          Dear Clyde,

          Many thanks for your reply.

          Firstly, I am adding -noestimchk- with the margin command but it says the noestimchk option not allowed. How to add this option correctly?
          Secondly, I am posting my output below. This is for the first time I am posting an output here. I am not sure how to post it properly.

          Code:
          . nbreg AvPA i.Regions##c.ChinaComm $vars i.recid i.Year, vce(cluster recid)
          note: 93.recid omitted because of collinearity
          note: 108.recid omitted because of collinearity
          note: 129.recid omitted because of collinearity
          note: 131.recid omitted because of collinearity
          
          Fitting Poisson model:
          
          Iteration 0:   log pseudolikelihood = -1112.1254  
          Iteration 1:   log pseudolikelihood =  -1014.123  
          Iteration 2:   log pseudolikelihood = -1013.3503  
          Iteration 3:   log pseudolikelihood = -1013.3499  
          Iteration 4:   log pseudolikelihood = -1013.3499  
          
          Fitting constant-only model:
          
          Iteration 0:   log pseudolikelihood = -1405.3531  
          Iteration 1:   log pseudolikelihood = -1265.9125  
          Iteration 2:   log pseudolikelihood = -1258.6133  
          Iteration 3:   log pseudolikelihood = -1258.5668  
          Iteration 4:   log pseudolikelihood = -1258.5668  
          
          Fitting full model:
          
          Iteration 0:   log pseudolikelihood = -1125.3866  
          Iteration 1:   log pseudolikelihood = -1072.4611  
          Iteration 2:   log pseudolikelihood = -1023.4222  (not concave)
          Iteration 3:   log pseudolikelihood = -1022.4619  
          Iteration 4:   log pseudolikelihood = -1015.7561  (not concave)
          Iteration 5:   log pseudolikelihood =  -1014.728  
          Iteration 6:   log pseudolikelihood = -1013.0476  
          Iteration 7:   log pseudolikelihood = -1012.9251  
          Iteration 8:   log pseudolikelihood = -1012.9191  
          Iteration 9:   log pseudolikelihood = -1012.9191  
          
          Negative binomial regression                    Number of obs     =        400
          Wald chi2(28)     =          .
          Dispersion           = mean                     Prob > chi2       =          .
          Log pseudolikelihood = -1012.9191               Pseudo R2         =     0.1952
          
          (Std. Err. adjusted for 67 clusters    in recid)
              
          Robust
          AvPA       Coef.   Std. Err.      z    P>z     [95% Conf.    Interval]
              
          Regions 
          East Asia & Pacific     .3993421   .2078436     1.92   0.055    -.0080238    .8067079
          Europe & Central Asia    -.2341186   .1893718    -1.24   0.216    -.6052806    .1370433
          Latin America & Caribbean    -.4042735   .1454963    -2.78   0.005    -.6894409    -.1191061
          Middle East & South Asia    -1.051309    .160349    -6.56   0.000    -1.365587    -.7370304
          
          ChinaComm   -.0054719   .0032969    -1.66   0.097    -.0119337    .0009899
          
          Regions#c.ChinaComm 
          East Asia & Pacific     .0170412   .0066665     2.56   0.011      .003975    .0301073
          Europe & Central Asia    -.0045519   .0051887    -0.88   0.380    -.0147216    .0056178
          Latin America & Caribbean     .0146773   .0097825     1.50   0.134     -.004496    .0338506
          Middle East & South Asia     .0054603   .0079187     0.69   0.490    -.0100601    .0209807
          
          AvFields    .0809264   .0142258     5.69   0.000     .0530442    .1088085
          WBComm    .0006814   .0040377     0.17   0.866    -.0072324    .0085952
          GDPGrowth    .0070837   .0036676     1.93   0.053    -.0001047    .0142721
          CPIGrowth     .117302   .5200761     0.23   0.822    -.9020285    1.136633
          GovExpenditures    .0002096   .0115351     0.02   0.986    -.0223987    .0228179
          HerReserves    .0368476   .0697293     0.53   0.597    -.0998194    .1735146
          Investments   -.0009753   .0046232    -0.21   0.833    -.0100367    .008086
          ExternDebt   -.0011231   .0011635    -0.97   0.334    -.0034035    .0011572
          UNVotingAffUS   -.0042187   .5562733    -0.01   0.994    -1.094494    1.086057
          DemocracyIndex    .0332686   .0126209     2.64   0.008     .0085321    .0580052
          
          recid 
          Angola      .490998   .2351235     2.09   0.037     .0301645    .9518315
          Argentina     .9375469   .1453702     6.45   0.000     .6526266    1.222467
          Armenia     .0364845   .1491634     0.24   0.807    -.2558704    .3288394
          Azerbaijan     .5664941   .2481418     2.28   0.022     .0801451    1.052843
          Bangladesh     1.002633    .109951     9.12   0.000     .7871327    1.218133
          Belarus     .2759178   .3499281     0.79   0.430    -.4099287    .9617643
          Bolivia     .2721115     .09128     2.98   0.003      .093206    .4510169
          Brazil     .4307272   .1040604     4.14   0.000     .2267725    .6346818
          Bulgaria    -.3642696   .1451656    -2.51   0.012     -.648789    -.0797502
          Burundi    -.1268907   .1693691    -0.75   0.454     -.458848    .2050666
          Cambodia    -.7001023   .1936162    -3.62   0.000    -1.079583    -.3206215
          Cameroon     1.015748   .1796122     5.66   0.000      .663715    1.367782
          Cape Verde     .0601052   .1329917     0.45   0.651    -.2005537    .3207641
          Central African Republic     .4654829   .1481664     3.14   0.002     .1750821    .7558837
          Chad     .1026964   .1949731     0.53   0.598    -.2794437    .4848366
          Colombia     .0050375   .0987148     0.05   0.959      -.18844    .198515
          Comoros    -.2188509   .1356493    -1.61   0.107    -.4847186    .0470169
          Congo, Democratic Republic of     .0839117   .2350036     0.36   0.721    -.3766868    .5445102
          Congo, Republic of     1.310998   .2022937     6.48   0.000     .9145098    1.707487
          Costa Rica    -.0198591   .0957695    -0.21   0.836    -.2075639    .1678457
          Djibouti    -.8349859   .2244143    -3.72   0.000     -1.27483    -.395142
          Ecuador     .1113069   .1611306     0.69   0.490    -.2045033    .4271171
          Egypt, Arab Republic of     .4670416   .1576827     2.96   0.003     .1579891    .776094
          Gabon     1.027173   .1820485     5.64   0.000     .6703644    1.383982
          Georgia     .2695822   .1367753     1.97   0.049     .0015075    .5376569
          Ghana    -.3233007   .0596287    -5.42   0.000    -.4401708    -.2064307
          Guyana    -.0273767    .223715    -0.12   0.903    -.4658501    .4110968
          Haiti     .5388891   .1320568     4.08   0.000     .2800626    .7977157
          India     .6802035     .14217     4.78   0.000     .4015555    .9588515
          Indonesia    -.7036069   .2118258    -3.32   0.001    -1.118778    -.2884361
          Jamaica     .4474359   .0809339     5.53   0.000     .2888083    .6060635
          Jordan     1.409902   .2255477     6.25   0.000     .9678364    1.851967
          Kazakhstan     .3707881   .2907324     1.28   0.202    -.1990368    .9406131
          Kenya    -.0206182   .1959006    -0.11   0.916    -.4045764    .36334
          Lao PDR    -.2750362   .1227011    -2.24   0.025    -.5155259    -.0345464
          Lesotho    -.4056063   .3207989    -1.26   0.206    -1.034361    .223148
          Liberia    -.0417803   .1554385    -0.27   0.788    -.3464341    .2628736
          Macedonia      .017181   .1283764     0.13   0.894    -.2344321    .2687941
          Madagascar     .0657541   .0687441     0.96   0.339    -.0689819    .2004901
          Malawi    -.3599446   .1394491    -2.58   0.010    -.6332598    -.0866295
          Mauritius    -.3196621   .1245528    -2.57   0.010    -.5637811    -.0755431
          Mexico     .1328705   .0936951     1.42   0.156    -.0507685    .3165095
          Moldova     .0829188    .136873     0.61   0.545    -.1853473    .351185
          Mongolia    -.9384252   .2399559    -3.91   0.000     -1.40873    -.4681202
          Montenegro     .1565579   .1914724     0.82   0.414    -.2187211    .5318368
          Morocco     .4747735   .1945905     2.44   0.015     .0933832    .8561639
          Mozambique    -.1367388   .1259846    -1.09   0.278    -.3836642    .1101866
          Nepal     1.054296   .1028167    10.25   0.000     .8527791    1.255813
          Nicaragua     .0284319   .1395119     0.20   0.839    -.2450063    .3018701
          Nigeria      .188949   .1328163     1.42   0.155    -.0713661    .4492641
          Pakistan     1.037444   .1141552     9.09   0.000     .8137035    1.261184
          Peru            0  (omitted)
          Philippines    -.6779857   .2144096    -3.16   0.002    -1.098221    -.2577506
          Romania     .1734572   .1040406     1.67   0.095    -.0304586    .377373
          Rwanda     .1296724   .1706222     0.76   0.447    -.2047411    .4640858
          Sierra Leone    -.1324622   .0721873    -1.83   0.067    -.2739468    .0090224
          Sri Lanka            0  (omitted)
          Tajikistan     .5127007   .3186581     1.61   0.108    -.1118577    1.137259
          Tanzania     .1232803   .1231361     1.00   0.317    -.1180621    .3646227
          Thailand    -.8103539    .242525    -3.34   0.001    -1.285694    -.3350136
          Tunisia      .266742    .152079     1.75   0.079    -.0313273    .5648113
          Turkey     .1916266   .1246915     1.54   0.124    -.0527643    .4360174
          Uganda     .0519416   .1344253     0.39   0.699    -.2115271    .3154104
          Ukraine    -.0577544   .1416549    -0.41   0.683    -.3353929    .2198841
          Vietnam            0  (omitted)
          Zambia            0  (omitted)
          
          Year 
          2002     -.262433   .1235177    -2.12   0.034    -.5045233    -.0203427
          2003    -.4358952   .1377407    -3.16   0.002    -.7058621    -.1659284
          2004     -.501171   .1078946    -4.65   0.000    -.7126405    -.2897014
          2005    -.7422219   .1252622    -5.93   0.000    -.9877313    -.4967126
          2006    -.7914895   .1449701    -5.46   0.000    -1.075626    -.5073533
          2007    -.8019043   .1475003    -5.44   0.000       -1.091    -.512809
          2008    -.9512423   .1560952    -6.09   0.000    -1.257183    -.6453014
          2009    -.9180771   .1581013    -5.81   0.000     -1.22795    -.6082042
          2010    -.8823936   .1548212    -5.70   0.000    -1.185838    -.5789496
          2011    -.8834462   .1451501    -6.09   0.000    -1.167935    -.5989572
          2012    -1.027585   .1480604    -6.94   0.000    -1.317778    -.737392
          2013    -1.050608   .1483953    -7.08   0.000    -1.341457    -.7597585
          2014    -1.053725   .1382543    -7.62   0.000    -1.324698    -.782751
          2015    -.9934422   .1961987    -5.06   0.000    -1.377985    -.6088998
          
          _cons    2.654007      .3512     7.56   0.000     1.965667    3.342346
              
          /lnalpha   -5.453549   1.092395                     -7.594605    -3.312493
              
          alpha    .0042811   .0046766                      .0005032    .0364252

          Regards,
          Imran Khan.

          Comment


          • #6
            Firstly, I am adding -noestimchk- with the margin command but it says the noestimchk option not allowed. How to add this option correctly?
            Sorry, that was a typo on my part. It's -noestimcheck-.

            Your -nbreg- output came out just fine here. Thanks. And I don't see anything troubling in it.

            Now, having also seen your regression, I suggest that instead of using dydx(*) in the -margins- command, you use dydx(list_of_variables_whose_marginal_effects_I'm_actua lly_interested_in). You will just waste a lot of time and pixels calculating the marginal effects of your year and recid indicators ("dummies,") unless calculating those marginal effects really contributes to your research goals. It's unusual for anybody to care about the marginal effects of those things. I'm not even sure you want the marginal effects of the region variables or even the ChinaComm variable. If you do, fine. But only ask Stata to calculate the ones you really want. The -margins- calculations are also pretty slow, so the time spent calculating them for variables you don't care about will be appreciable.

            Comment


            • #7
              Dear Clyde,

              Many thanks for your reply.

              The suggested option worked fine.

              I am also able to save much more time by using dydx for the selected variables.

              Best regards,
              Imran Khan.

              Comment

              Working...
              X