Announcement

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

  • Precise Interpretation of Difference in Difference Regression Coefficients

    I am new to econometrics and want to verify that I have the correct precise interpretation for the coefficients in my two models.


    1. The dependent variable is the % change in workplace mobility. My primary coefficient of interest in the DID framework is: income_category * post, where income_category categorizes all the countries in my sample (n=113) into either a low, low-middle, upper-middle, or high income country and post is a binary variable the designates the time period before/after a policy was implemented. Upper-income countries are the reference group.

    The coefficient for low-income * post is 13.27*** and I think that be interpreted as:

    Low-income countries’ workplace mobility is, on average, 13.27 percentage points higher than upper-income countries’ workplace mobility after the policy was implemented. The regression coefficient is statistically significant at the 0.01 level, meaning that there is a probability of 0.01 that this result is not due to chance.


    2. In the second regression the dependent variable is growth rate and again my primary independent variable of interest is the same income_category * post variable described above.

    The coefficient in this model for low-income * post is 2.655*** and I think that is interpreted as:

    Low-income countries’ growth rate is, on average, 2.665 percentage points higher than upper-income countries’ growth rate after the policy was implemented. The regression coefficient is statistically significant at the 0.01 level, meaning that there is a probability of 0.01 that this result is not due to chance.


    Are my precise interpretations correct?
    Last edited by Morgan Pincombe; 07 Jan 2021, 08:21.

  • #2
    Low-income countries’ workplace mobility is, on average, 13.27 percentage points higher than upper-income countries’ workplace mobility after the policy was implemented.
    Not quite. The change in low income countries' workplace mobility following the intervention is, on average, 13.27 percentage points greater than the change in upper income countries' workplace mobility from pre to post.

    The regression coefficient is statistically significant at the 0.01 level, meaning that there is a probability of 0.01 that this result is not due to chance.
    Not even close. In a population (real or hypothetical) where the change in workplace mobility in lower income countries between the pre and post periods is the same as the change in workplace mobility in lower income countries between those same periods, then the probability that a random sample of this size from that population, when analyzed the same way as what you have done here, would yield a result of 13.27 or larger in magnitude is 0.01.

    The complexity of the correct interpretation, and the fact that, many, probably most, people misunderstand it, is a major reason why the American Statistical Association has recommended that statistical significance testing be abandoned. See https://www.tandfonline.com/doi/full...5.2019.1583913 for the "executive summary" and https://www.tandfonline.com/toc/utas20/73/sup1 for all 43 supporting articles. Or https://www.nature.com/articles/d41586-019-00857-9 for the tl;dr.

    Your interpretations for the second regression are also incorrect in exactly the same ways and can be corrected in the same way.

    Comment


    • #3
      Thank you for your response, Clyde. I’ve been reviewing the work of Richard Williams Using the Margins Command to Estimate and Interpret Adjusted Predictions and Marginal Effects and the Margins manual in Stata rmargins.pdf (stata.com). I know that the interpretations of interactions can be more easily interpreted using margins. In the case of this regression framework, would I want to use margins to help people understand the coefficients?

      As mentioned, the dependent variable is the % change in workplace mobility. My primary coefficient of interest in the DID framework is: income_category * post, where income_category categorizes all the countries in my sample (n=113) into either a low, low-middle, upper-middle, or high income country and post is a binary variable the designates the time period before/after a policy was implemented. Upper-income countries are the reference group. Here is the regression:

      Code:
      xtreg workplace income_category post b4.income_category##post i.date i.id, cluster(id)
      After running this regression, is the following code correct in order to estimate margins?

      Code:
      margins b4.income_category##post, atmeans
      Would the output from this margins command represent the expected mean % change in mobility in each income group after the policy was implemented (ie. during the treatment period)?
      Last edited by Morgan Pincombe; 08 Jan 2021, 07:02.

      Comment


      • #4
        You are changing your story. Is this a different study? You originally said that the DV is the level of workplace mobility. Now you say it is the % change in workplace mobility. Which is it?

        Comment


        • #5
          The dependent variable is the % change in workplace mobility, calculated as the change between the current level of workplace mobility compared to the level of workplace mobility in a reference baseline period. This definition of the dependent variable is used throughout the study.

          Comment


          • #6
            Thanks for the clarification. In that case, the -margins- command you show in #3 will, indeed, give you the expected change in workplace mobility in each combination of income category and pre-post, conditional on all of the other variables being at their means. In addition, it will also give you the expected changes in workplace mobility in each level of pre-post (without regard to income category) and in income category (without regard to pre-post). These additional ones may or may not be of any interest to you. If they are not, you can avoid them by using a single # instead of the double ## in your -margins- command. (But you must still use ## in the -xtreg- command.)

            Comment


            • #7
              Thank you very much for the response.

              I ran the following regression:
              Code:
              xtreg workplaces b4.income_cat##post strin_ind i.n_polity_2018 over65_2019 covid_cases_prev_day ghsindex i.id i.date, cluster(id)
              and then the margins command:
              Code:
              margins b4.income_cat#post, atmeans
              The margins were not estimable so I reviewed the listserv and searched for singleton dummies following this post:
              "Not Estimable" results with Margins Command - Statalist

              The code and results were:
              Code:
              findname , all(inlist(@, 0, 1, .))
              post          upmidincome   anocracy      lowmidinco~t  postlock      lowmid~tlock  lowinc~glock  highin~glock
              lowincome     highincome    democracy     upmidincom~t  postreglock   upmidi~tlock  lowmid~glock
              lowmidincome  autocracy     lowincome_~t  highincome~t  lowinc~tlock  highin~tlock  upmidi~glock
               
              . tabstat `r(varlist)' , s(sum) col(stat)
               
                  variable |       sum
              -------------+----------
                      post |     11865
                 lowincome |      1300
              lowmidincome |      3640
               upmidincome |      4030
                highincome |      5720
                 autocracy |      1300
                  anocracy |      3640
                 democracy |      9750
              lowincome_~t |      1050
              lowmidinco~t |      2940
              upmidincom~t |      3255
              highincome~t |      4620
                  postlock |     10429
               postreglock |     10444
              lowinc~tlock |       778
              lowmid~tlock |      2496
              upmidi~tlock |      2919
              highin~tlock |      4236
              lowinc~glock |       904
              lowmid~glock |      2459
              upmidi~glock |      2883
              
              highin~glock |      4198
              
               
              and
               
              tab income_cat post
               
                         | Dummy variable for on
                         |   or after March 11
              income_cat |         0          1 |     Total
              -----------+----------------------+----------
                       1 |       250      1,050 |     1,300
                       2 |       700      2,940 |     3,640
                       3 |       775      3,255 |     4,030
                       4 |     1,100      4,620 |     5,720
              -----------+----------------------+----------
                   Total |     2,825     11,865 |    14,690
              Therefore, I do not think I have singleton dummies. I am not sure why the margins are not estimable? Can you please suggest a next step that I can try. I have pasted the results of both the regression and the margins in the response below because it exceeded the maximum character limit for this response.

              Thank you in advance.

              Comment


              • #8
                Code:
                xtreg workplaces b4.income_cat##post strin_ind i.n_polity_2018 over65_2019 covid_cases_prev_day ghsindex i.id i.date, cluster(id)
                note: 107.id omitted because of collinearity
                note: 109.id omitted because of collinearity
                note: 111.id omitted because of collinearity
                note: 112.id omitted because of collinearity
                note: 113.id omitted because of collinearity
                note: 114.id omitted because of collinearity
                note: 115.id omitted because of collinearity
                note: 22089.date omitted because of collinearity
                 
                Random-effects GLS regression                   Number of obs     =     14,690
                Group variable: id                              Number of groups  =        113
                 
                R-sq:                                           Obs per group:
                     within  = 0.7273                                         min =        130
                     between = 1.0000                                         avg =      130.0
                     overall = 0.7864                                         max =        130
                 
                                                                Wald chi2(112)    =          .
                corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =          .
                 
                                                              (Std. Err. adjusted for 113 clusters in id)
                -----------------------------------------------------------------------------------------
                                        |               Robust
                             workplaces |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                ------------------------+----------------------------------------------------------------
                             income_cat |
                                     1  |  -182.2931   12.41067   -14.69   0.000    -206.6176   -157.9687
                                     2  |  -78.21456   6.076872   -12.87   0.000    -90.12501   -66.30411
                                     3  |  -137.9482   10.09162   -13.67   0.000    -157.7274    -118.169
                                        |
                                 1.post |  -7.664248   2.849008    -2.69   0.007     -13.2482   -2.080294
                                        |
                        income_cat#post |
                                   1 1  |   13.26967   4.175803     3.18   0.001      5.08525     21.4541
                                   2 1  |   5.621528    3.00051     1.87   0.061    -.2593643    11.50242
                                   3 1  |   .1144553   2.224101     0.05   0.959    -4.244702    4.473613
                                        |
                              strin_ind |  -.4519343   .0427955   -10.56   0.000    -.5358118   -.3680567
                                        |
                          n_polity_2018 |
                                     2  |    40.8436   4.968816     8.22   0.000      31.1049     50.5823
                                     3  |  -49.05777   1.785438   -27.48   0.000    -52.55717   -45.55838
                                        |
                            over65_2019 |  -6.621084   .4757779   -13.92   0.000    -7.553592   -5.688577
                   covid_cases_prev_day |  -2.85e-06   1.92e-06    -1.49   0.137    -6.60e-06    9.08e-07
                               ghsindex |   .0997958   .0539356     1.85   0.064    -.0059159    .2055076
                                        |
                                     id |
                                Angola  |  -94.39131   6.252155   -15.10   0.000    -106.6453   -82.13731
                             Argentina  |   110.4748   7.414708    14.90   0.000     95.94228    125.0074
                             Australia  |   5.902271   1.340145     4.40   0.000     3.275634    8.528908
                               Austria  |   16.07844   1.083566    14.84   0.000     13.95469    18.20219
                               Bahrain  |  -123.4313   7.316945   -16.87   0.000    -137.7722   -109.0903
                            Bangladesh  |  -40.19999   .3916838  -102.63   0.000    -40.96768    -39.4323
                               Belarus  |   81.08202   8.967187     9.04   0.000     63.50666    98.65738
                               Belgium  |   13.18329    1.01636    12.97   0.000     11.19126    15.17532
                               Bolivia  |   7.089456   2.524264     2.81   0.005      2.14199    12.03692
                Bosnia and Herzegovina  |    65.6223     4.3998    14.91   0.000     56.99885    74.24575
                              Botswana  |   71.36267   5.515127    12.94   0.000     60.55322    82.17212
                                Brazil  |   102.3048   6.686244    15.30   0.000     89.19996    115.4096
                              Bulgaria  |   174.4886   12.67681    13.76   0.000     149.6425    199.3347
                          Burkina Faso  |   105.1971   6.522655    16.13   0.000      92.4129    117.9812
                              Cambodia  |  -83.83421    5.90713   -14.19   0.000    -95.41198   -72.25645
                              Cameroon  |  -86.44585   6.538465   -13.22   0.000      -99.261   -73.63069
                                Canada  |   1.291639   .4333618     2.98   0.003     .4422652    2.141012
                                 Chile  |  -31.93578   2.272137   -14.06   0.000    -36.38909   -27.48248
                              Colombia  |   87.35623   6.992175    12.49   0.000     73.65182    101.0606
                            Costa Rica  |   103.6414   7.367321    14.07   0.000     89.20173    118.0811
                         Cote d'Ivoire  |  -84.96239   6.500376   -13.07   0.000     -97.7029   -72.22189
                               Croatia  |   33.62758   2.220993    15.14   0.000     29.27452    37.98065
                        Czech Republic  |   30.63745   1.756363    17.44   0.000     27.19505    34.07986
                               Denmark  |    26.7708   .8631295    31.02   0.000      25.0791     28.4625
                    Dominican Republic  |   74.43817   6.615673    11.25   0.000     61.47169    87.40465
                               Ecuador  |   -23.4464   .8124319   -28.86   0.000    -25.03874   -21.85407
                                 Egypt  |   -78.4795   5.554824   -14.13   0.000    -89.36675   -67.59224
                           El Salvador  |    18.6165   2.662234     6.99   0.000     13.39861    23.83438
                               Estonia  |   22.08097   1.581127    13.97   0.000     18.98202    25.17992
                                  Fiji  |   4.074794   .6180665     6.59   0.000     2.863406    5.286182
                               Finland  |   31.94236   2.015866    15.85   0.000     27.99133    35.89338
                                France  |   22.41668    1.50449    14.90   0.000     19.46793    25.36542
                                 Gabon  |  -19.39646   .9700171   -20.00   0.000    -21.29766   -17.49527
                               Georgia  |   126.5387   9.534504    13.27   0.000     107.8514     145.226
                               Germany  |   38.48623   2.048134    18.79   0.000     34.47196    42.50049
                                 Ghana  |    1.07315   .4189855     2.56   0.010     .2519531    1.894346
                                Greece  |   40.29529   2.697371    14.94   0.000     35.00854    45.58204
                             Guatemala  |   70.16469   5.950232    11.79   0.000     58.50245    81.82693
                                 Haiti  |   20.34986   1.199177    16.97   0.000     17.99951     22.7002
                              Honduras  |  -.5517921   2.169918    -0.25   0.799    -4.804753    3.701169
                               Hungary  |   26.72969   1.607581    16.63   0.000     23.57889    29.88049
                                 India  |     9.3149   1.707203     5.46   0.000     5.968843    12.66096
                             Indonesia  |   78.66514   4.969291    15.83   0.000      68.9255    88.40477
                                  Iraq  |   72.86054     5.6744    12.84   0.000     61.73892    83.98216
                               Ireland  |  -22.19081   1.366136   -16.24   0.000    -24.86839   -19.51323
                                Israel  |  -21.42617   1.786023   -12.00   0.000    -24.92671   -17.92563
                                 Italy  |   41.24056    3.44073    11.99   0.000     34.49685    47.98426
                               Jamaica  |   97.90267   7.848265    12.47   0.000     82.52035     113.285
                                 Japan  |   83.03572   5.272037    15.75   0.000     72.70272    93.36872
                                Jordan  |  -35.22783   1.925703   -18.29   0.000    -39.00214   -31.45352
                            Kazakhstan  |    41.4304   4.959921     8.35   0.000     31.70913    51.15167
                                 Kenya  |    .415386    1.45336     0.29   0.775    -2.433148     3.26392
                            Kyrgyzstan  |   2.517124   1.076228     2.34   0.019     .4077559    4.626492
                                  Laos  |  -37.89816   1.431019   -26.48   0.000     -40.7029   -35.09341
                                Latvia  |   29.35882   1.431974    20.50   0.000      26.5522    32.16544
                               Lebanon  |   81.59988   6.320003    12.91   0.000      69.2129    93.98686
                                 Libya  |  -4.278651   1.096511    -3.90   0.000    -6.427774   -2.129529
                             Lithuania  |   29.95857   1.791848    16.72   0.000     26.44661    33.47053
                            Luxembourg  |   -26.1018   .4516402   -57.79   0.000      -26.987    -25.2166
                              Malaysia  |    72.4137   5.056771    14.32   0.000     62.50262    82.32479
                                  Mali  |    14.2959   .7360927    19.42   0.000     12.85318    15.73861
                                Mexico  |   81.55814   5.578654    14.62   0.000     70.62418     92.4921
                              Mongolia  |   25.43584   .9685574    26.26   0.000      23.5375    27.33418
                               Morocco  |   -77.1258   4.788971   -16.10   0.000    -86.51201   -67.73959
                            Mozambique  |   18.72661   .8254108    22.69   0.000     17.10883    20.34438
                               Namibia  |      65.31   4.862798    13.43   0.000     55.77909    74.84091
                                 Nepal  |    5.00587   2.038945     2.46   0.014     1.009611    9.002128
                           Netherlands  |   21.96336    .455918    48.17   0.000     21.06978    22.85694
                           New Zealand  |   4.447076   .1868708    23.80   0.000     4.080816    4.813336
                             Nicaragua  |  -.6650503   1.586764    -0.42   0.675    -3.775052    2.444951
                                 Niger  |    6.72398   1.213185     5.54   0.000     4.346181    9.101779
                               Nigeria  |  -3.844044    .861463    -4.46   0.000    -5.532481   -2.155608
                                Norway  |   4.614458   .1679947    27.47   0.000     4.285194    4.943722
                                  Oman  |   -128.486   7.536066   -17.05   0.000    -143.2564   -113.7156
                              Pakistan  |   3.987591    1.43983     2.77   0.006     1.165576    6.809605
                                Panama  |  -65.39467    3.36872   -19.41   0.000    -71.99724    -58.7921
                      Papua New Guinea  |  -60.77683   5.807449   -10.47   0.000    -72.15922   -49.39444
                              Paraguay  |   92.22389   6.483923    14.22   0.000     79.51564    104.9321
                                  Peru  |   73.27124   6.707476    10.92   0.000     60.12483    86.41765
                           Philippines  |  -2.623461   1.597342    -1.64   0.101    -5.754193    .5072711
                                Poland  |   20.27546   .8522012    23.79   0.000     18.60518    21.94575
                              Portugal  |   35.36669   2.594965    13.63   0.000     30.28065    40.45273
                                 Qatar  |  -134.1138   7.846938   -17.09   0.000    -149.4935   -118.7341
                               Romania  |   23.44668   1.710536    13.71   0.000     20.09409    26.79927
                                Russia  |   51.26015   3.620166    14.16   0.000     44.16475    58.35554
                                Rwanda  |   2.347471    .125451    18.71   0.000     2.101592    2.593351
                          Saudi Arabia  |  -131.0615    7.35058   -17.83   0.000    -145.4684   -116.6546
                               Senegal  |  -.9990092   .6021041    -1.66   0.097    -2.179112    .1810931
                                Serbia  |   147.0402   11.16823    13.17   0.000     125.1508    168.9295
                             Singapore  |  -120.7845   8.620705   -14.01   0.000    -137.6808   -103.8882
                              Slovakia  |   3.407509   .3753898     9.08   0.000     2.671759     4.14326
                              Slovenia  |   24.30275   1.128958    21.53   0.000     22.09003    26.51547
                          South Africa  |   65.87467   4.836064    13.62   0.000     56.39615    75.35318
                           South Korea  |   13.26209   1.458681     9.09   0.000     10.40313    16.12105
                                 Spain  |   12.57177   1.266864     9.92   0.000     10.08876    15.05478
                             Sri Lanka  |   38.23099   4.038803     9.47   0.000     30.31508     46.1469
                                Sweden  |   23.38316   1.271309    18.39   0.000     20.89144    25.87488
                           Switzerland  |   17.32323   .5293265    32.73   0.000     16.28577    18.36069
                            Tajikistan  |   10.07894   1.202045     8.38   0.000     7.722973     12.4349
                              Tanzania  |  -98.62941   6.821316   -14.46   0.000    -111.9989   -85.25988
                              Thailand  |   31.90518    .607483    52.52   0.000     30.71454    33.09583
                                  Togo  |   13.56603   .4885608    27.77   0.000     12.60847    14.52359
                   Trinidad and Tobago  |  -32.74486   1.730653   -18.92   0.000    -36.13688   -29.35284
                                Turkey  |          0  (omitted)
                                Uganda  |  -2.376299     .95906    -2.48   0.013    -4.256022   -.4965758
                               Ukraine  |          0  (omitted)
                  United Arab Emirates  |  -146.0221   8.341187   -17.51   0.000    -162.3705   -129.6736
                        United Kingdom  |          0  (omitted)
                         United States  |          0  (omitted)
                               Uruguay  |          0  (omitted)
                               Vietnam  |          0  (omitted)
                                Zambia  |          0  (omitted)
                                        |
                                   date |
                                 21961  |  -1.061946    .448627    -2.37   0.018    -1.941239   -.1826537
                                 21962  |   -.203539   .9505736    -0.21   0.830    -2.066629    1.659551
                                 21963  |   .8495587   .6216147     1.37   0.172    -.3687837    2.067901
                                 21964  |   .5177736    .612297     0.85   0.398    -.6823065    1.717854
                                 21965  |   .1573965   .6486805     0.24   0.808    -1.113994    1.428787
                                 21966  |  -.1268615   .8452863    -0.15   0.881    -1.783592    1.529869
                                 21967  |  -.3464605   .6091751    -0.57   0.570    -1.540422    .8475008
                                 21968  |  -.1496267   .5657976    -0.26   0.791     -1.25857    .9593163
                                 21969  |  -5.406252   2.102285    -2.57   0.010    -9.526656   -1.285848
                                 21970  |  -4.786514   2.058701    -2.33   0.020    -8.821494   -.7515332
                                 21971  |   -.277318   1.221072    -0.23   0.820    -2.670574    2.115938
                                 21972  |   1.358442   .9039912     1.50   0.133    -.4133478    3.130233
                                 21973  |   2.754941   .8228547     3.35   0.001     1.142176    4.367707
                                 21974  |   2.923623   .5356616     5.46   0.000     1.873745      3.9735
                                 21975  |   2.659915   .6722257     3.96   0.000     1.342377    3.977453
                                 21976  |   3.823218   1.189301     3.21   0.001     1.492232    6.154205
                                 21977  |   4.730261   .9680643     4.89   0.000     2.832889    6.627632
                                 21978  |   5.437784   .7224947     7.53   0.000      4.02172    6.853847
                                 21979  |   5.854646   .7765615     7.54   0.000     4.332613    7.376678
                                 21980  |   5.994397   .9379553     6.39   0.000     4.156038    7.832756
                                 21981  |   4.833312   .6526621     7.41   0.000     3.554117    6.112506
                                 21982  |   3.914834   .6973342     5.61   0.000     2.548084    5.281584
                                 21983  |   .6579443   1.647179     0.40   0.690    -2.570467    3.886355
                                 21984  |   5.755982   1.039459     5.54   0.000     3.718679    7.793285
                                 21985  |   10.26084      2.763     3.71   0.000     4.845458    15.67622
                                 21986  |   10.35713    2.77613     3.73   0.000     4.916015    15.79824
                                 21987  |   10.73909   2.547667     4.22   0.000     5.745752    15.73242
                                 21988  |    11.4526   2.422162     4.73   0.000     6.705251    16.19995
                                 21989  |   9.202491   2.467611     3.73   0.000     4.366063    14.03892
                                 21990  |   4.825491   2.124211     2.27   0.023     .6621145    8.988867
                                 21991  |   .9193839   1.999074     0.46   0.646    -2.998729    4.837496
                                 21992  |   -.639603   1.841496    -0.35   0.728     -4.24887    2.969664
                                 21993  |  -1.518179   1.830191    -0.83   0.407    -5.105287     2.06893
                                 21994  |  -1.997488   1.794356    -1.11   0.266    -5.514361    1.519385
                                 21995  |   1.878473   1.953428     0.96   0.336    -1.950176    5.707121
                                 21996  |   1.106709   1.899352     0.58   0.560    -2.615954    4.829371
                                 21997  |  -8.521439   2.042993    -4.17   0.000    -12.52563   -4.517246
                                 21998  |  -10.32627   1.777802    -5.81   0.000     -13.8107   -6.841842
                                 21999  |  -11.47829   1.827796    -6.28   0.000     -15.0607   -7.895872
                                 22000  |  -11.88866   1.778369    -6.69   0.000    -15.37419   -8.403116
                                 22001  |   -9.98445   1.789023    -5.58   0.000    -13.49087   -6.478029
                                 22002  |  -2.322481   1.829761    -1.27   0.204    -5.908746    1.263785
                                 22003  |   .4047355   1.762401     0.23   0.818    -3.049506    3.858977
                                 22004  |  -11.80255    1.72844    -6.83   0.000    -15.19023   -8.414875
                                 22005  |   -12.6901   1.705906    -7.44   0.000    -16.03362   -9.346589
                                 22006  |  -13.01783   1.684571    -7.73   0.000    -16.31953   -9.716136
                                 22007  |  -13.72424   1.710691    -8.02   0.000    -17.07713   -10.37135
                                 22008  |  -11.46248   1.766594    -6.49   0.000    -14.92494   -8.000017
                                 22009  |  -2.208454   1.885753    -1.17   0.242    -5.904461    1.487554
                                 22010  |   .4596511    1.77747     0.26   0.796    -3.024126    3.943429
                                 22011  |  -13.10459   1.748718    -7.49   0.000    -16.53202   -9.677168
                                 22012  |  -14.92814   1.790552    -8.34   0.000    -18.43756   -11.41872
                                 22013  |  -14.72032   1.804128    -8.16   0.000    -18.25635   -11.18429
                                 22014  |   -16.6006     1.8926    -8.77   0.000    -20.31003   -12.89117
                                 22015  |  -23.54777   2.176658   -10.82   0.000    -27.81395    -19.2816
                                 22016  |  -5.511654   1.872894    -2.94   0.003    -9.182459   -1.840849
                                 22017  |  -1.013171   1.762675    -0.57   0.565    -4.467952    2.441609
                                 22018  |   -23.7529   2.109839   -11.26   0.000    -27.88811   -19.61769
                                 22019  |   -12.4707   1.699374    -7.34   0.000    -15.80142   -9.139994
                                 22020  |  -12.62232   1.691062    -7.46   0.000    -15.93674   -9.307896
                                 22021  |  -11.40507   1.633153    -6.98   0.000    -14.60599   -8.204155
                                 22022  |  -10.36664   1.699866    -6.10   0.000    -13.69832   -7.034963
                                 22023  |  -.5198767   1.849857    -0.28   0.779     -4.14553    3.105777
                                 22024  |   2.033275   1.780782     1.14   0.254    -1.456995    5.523544
                                 22025  |  -11.12472   1.663106    -6.69   0.000    -14.38435   -7.865092
                                 22026  |  -9.902059   1.584893    -6.25   0.000    -13.00839   -6.795726
                                 22027  |  -9.118314   1.553819    -5.87   0.000    -12.16374   -6.072884
                                 22028  |  -9.323879   1.616401    -5.77   0.000    -12.49197    -6.15579
                                 22029  |  -7.562714   1.678806    -4.50   0.000    -10.85311   -4.272315
                                 22030  |   1.760865   1.836693     0.96   0.338    -1.838988    5.360717
                                 22031  |   5.092604   1.743887     2.92   0.003     1.674649     8.51056
                                 22032  |  -8.516129   1.654977    -5.15   0.000    -11.75982   -5.272434
                                 22033  |    -7.5188   1.586926    -4.74   0.000    -10.62912   -4.408483
                                 22034  |  -7.067311   1.594875    -4.43   0.000    -10.19321   -3.941412
                                 22035  |  -7.136559   1.567649    -4.55   0.000     -10.2091   -4.064023
                                 22036  |    -24.155   2.085495   -11.58   0.000     -28.2425   -20.06751
                                 22037  |   3.300689   1.731646     1.91   0.057     -.093274    6.694652
                                 22038  |   8.487998   1.765483     4.81   0.000     5.027716    11.94828
                                 22039  |  -5.627167   1.552342    -3.62   0.000      -8.6697   -2.584633
                                 22040  |   -5.39415   1.636639    -3.30   0.001    -8.601903   -2.186396
                                 22041  |  -4.603564   1.528001    -3.01   0.003    -7.598391   -1.608738
                                 22042  |  -4.072086   1.512069    -2.69   0.007    -7.035686   -1.108486
                                 22043  |  -2.515746   1.766513    -1.42   0.154    -5.978047    .9465559
                                 22044  |   9.479886   1.757645     5.39   0.000     6.034965    12.92481
                                 22045  |    14.1204   1.793941     7.87   0.000     10.60434    17.63646
                                 22046  |   -1.52042   1.436349    -1.06   0.290    -4.335613    1.294773
                                 22047  |  -1.182469   1.373507    -0.86   0.389    -3.874493    1.509555
                                 22048  |  -.8149775   1.389658    -0.59   0.558    -3.538657    1.908702
                                 22049  |  -1.713615   1.487287    -1.15   0.249    -4.628643    1.201413
                                 22050  |   .4610081   1.664242     0.28   0.782    -2.800847    3.722863
                                 22051  |   12.08034   1.789182     6.75   0.000     8.573603    15.58707
                                 22052  |   14.77792   1.802234     8.20   0.000     11.24561    18.31024
                                 22053  |   .5801872   1.466649     0.40   0.692    -2.294392    3.454766
                                 22054  |    .256931   1.432451     0.18   0.858    -2.550621    3.064483
                                 22055  |  -.5886484   1.446345    -0.41   0.684    -3.423433    2.246136
                                 22056  |  -7.160915   1.865788    -3.84   0.000    -10.81779   -3.504038
                                 22057  |   .9525287   1.612737     0.59   0.555    -2.208378    4.113435
                                 22058  |   10.92631   2.026842     5.39   0.000     6.953771    14.89884
                                 22059  |   10.74735   2.330144     4.61   0.000     6.180352    15.31435
                                 22060  |  -9.887192   2.142068    -4.62   0.000    -14.08557   -5.688815
                                 22061  |   -1.49902   1.678059    -0.89   0.372    -4.787955    1.789915
                                 22062  |   1.349088   1.382277     0.98   0.329    -1.360124    4.058301
                                 22063  |   1.712775   1.366997     1.25   0.210    -.9664893     4.39204
                                 22064  |   4.590718   1.379396     3.33   0.001     1.887151    7.294285
                                 22065  |   18.36891   1.891712     9.71   0.000     14.66122    22.07659
                                 22066  |   20.75872   1.937205    10.72   0.000     16.96187    24.55557
                                 22067  |  -3.027479   1.904445    -1.59   0.112    -6.760122    .7051648
                                 22068  |   3.764097   1.207203     3.12   0.002     1.398022    6.130171
                                 22069  |   3.746635   1.081798     3.46   0.001     1.626351    5.866919
                                 22070  |   3.634407   1.070291     3.40   0.001     1.536675    5.732139
                                 22071  |   4.395653   1.283528     3.42   0.001     1.879985    6.911321
                                 22072  |   17.91021    1.56956    11.41   0.000     14.83393    20.98649
                                 22073  |   20.60896   1.715006    12.02   0.000     17.24761    23.97031
                                 22074  |   2.626356   1.275483     2.06   0.039     .1264546    5.126258
                                 22075  |   3.944942   .9668729     4.08   0.000     2.049906    5.839978
                                 22076  |   3.586002   .9846092     3.64   0.000     1.656204    5.515801
                                 22077  |   .3447585   1.444184     0.24   0.811     -2.48579    3.175307
                                 22078  |   4.226439   1.189808     3.55   0.000     1.894457    6.558421
                                 22079  |   19.63163   1.958932    10.02   0.000     15.79219    23.47106
                                 22080  |   21.95638   1.770755    12.40   0.000     18.48576      25.427
                                 22081  |   4.014209   .9799987     4.10   0.000     2.093447    5.934971
                                 22082  |   3.719309   .8747558     4.25   0.000     2.004819    5.433799
                                 22083  |   3.272594   .8065908     4.06   0.000     1.691705    4.853483
                                 22084  |   2.519082   .8276926     3.04   0.002     .8968347     4.14133
                                 22085  |   3.613871   1.060837     3.41   0.001     1.534669    5.693074
                                 22086  |   17.74297   1.591025    11.15   0.000     14.62461    20.86132
                                 22087  |   20.99462   1.835582    11.44   0.000     17.39695    24.59229
                                 22088  |   .1841212   .7081921     0.26   0.795     -1.20391    1.572152
                                 22089  |          0  (omitted)
                                        |
                                  _cons |   153.8666   6.468925    23.79   0.000     141.1877    166.5454
                ------------------------+----------------------------------------------------------------
                                sigma_u |          0
                                sigma_e |  11.665612
                                    rho |          0   (fraction of variance due to u_i)
                -----------------------------------------------------------------------------------------
                 
                .
                end of do-file

                Comment


                • #9
                  Code:
                  margins b4.income_cat#post, atmeans
                   
                  Adjusted predictions                            Number of obs     =     14,690
                  Model VCE    : Robust
                   
                  Expression   : Linear prediction, predict()
                  at           : 1.income_cat    =    .0884956 (mean)
                                 2.income_cat    =    .2477876 (mean)
                                 3.income_cat    =    .2743363 (mean)
                                 4.income_cat    =    .3893805 (mean)
                                 0.post          =    .1923077 (mean)
                                 1.post          =    .8076923 (mean)
                                 strin_ind       =    58.87702 (mean)
                                 1.n_pol~2018    =    .0884956 (mean)
                                 2.n_pol~2018    =    .2477876 (mean)
                                 3.n_pol~2018    =    .6637168 (mean)
                                 over65_2019     =    10.33369 (mean)
                                 covid_case~y    =    24395.07 (mean)
                                 ghsindex        =    47.20177 (mean)
                                 1.id            =    .0088496 (mean)
                                 2.id            =    .0088496 (mean)
                                 3.id            =    .0088496 (mean)
                                 4.id            =    .0088496 (mean)
                                 5.id            =    .0088496 (mean)
                                 6.id            =    .0088496 (mean)
                                 7.id            =    .0088496 (mean)
                                 8.id            =    .0088496 (mean)
                                 9.id            =    .0088496 (mean)
                                 11.id           =    .0088496 (mean)
                                 12.id           =    .0088496 (mean)
                                 13.id           =    .0088496 (mean)
                                 14.id           =    .0088496 (mean)
                                 15.id           =    .0088496 (mean)
                                 16.id           =    .0088496 (mean)
                                 17.id           =    .0088496 (mean)
                                 18.id           =    .0088496 (mean)
                                 19.id           =    .0088496 (mean)
                                 20.id           =    .0088496 (mean)
                                 21.id           =    .0088496 (mean)
                                 22.id           =    .0088496 (mean)
                                 23.id           =    .0088496 (mean)
                                 24.id           =    .0088496 (mean)
                                 25.id           =    .0088496 (mean)
                                 26.id           =    .0088496 (mean)
                                 27.id           =    .0088496 (mean)
                                 28.id           =    .0088496 (mean)
                                 29.id           =    .0088496 (mean)
                                 30.id           =    .0088496 (mean)
                                 31.id           =    .0088496 (mean)
                                 32.id           =    .0088496 (mean)
                                 33.id           =    .0088496 (mean)
                                 34.id           =    .0088496 (mean)
                                 35.id           =    .0088496 (mean)
                                 36.id           =    .0088496 (mean)
                                 37.id           =    .0088496 (mean)
                                 38.id           =    .0088496 (mean)
                                 39.id           =    .0088496 (mean)
                                 40.id           =    .0088496 (mean)
                                 41.id           =    .0088496 (mean)
                                 42.id           =    .0088496 (mean)
                                 43.id           =    .0088496 (mean)
                                 44.id           =    .0088496 (mean)
                                 45.id           =    .0088496 (mean)
                                 46.id           =    .0088496 (mean)
                                 47.id           =    .0088496 (mean)
                                 48.id           =    .0088496 (mean)
                                 49.id           =    .0088496 (mean)
                                 50.id           =    .0088496 (mean)
                                 51.id           =    .0088496 (mean)
                                 52.id           =    .0088496 (mean)
                                 53.id           =    .0088496 (mean)
                                 54.id           =    .0088496 (mean)
                                 55.id           =    .0088496 (mean)
                                 56.id           =    .0088496 (mean)
                                 57.id           =    .0088496 (mean)
                                 58.id           =    .0088496 (mean)
                                 59.id           =    .0088496 (mean)
                                 60.id           =    .0088496 (mean)
                                 61.id           =    .0088496 (mean)
                                 62.id           =    .0088496 (mean)
                                 63.id           =    .0088496 (mean)
                                 65.id           =    .0088496 (mean)
                                 66.id           =    .0088496 (mean)
                                 67.id           =    .0088496 (mean)
                                 68.id           =    .0088496 (mean)
                                 69.id           =    .0088496 (mean)
                                 70.id           =    .0088496 (mean)
                                 71.id           =    .0088496 (mean)
                                 72.id           =    .0088496 (mean)
                                 73.id           =    .0088496 (mean)
                                 74.id           =    .0088496 (mean)
                                 75.id           =    .0088496 (mean)
                                 76.id           =    .0088496 (mean)
                                 77.id           =    .0088496 (mean)
                                 78.id           =    .0088496 (mean)
                                 79.id           =    .0088496 (mean)
                                 80.id           =    .0088496 (mean)
                                 81.id           =    .0088496 (mean)
                                 82.id           =    .0088496 (mean)
                                 83.id           =    .0088496 (mean)
                                 84.id           =    .0088496 (mean)
                                 85.id           =    .0088496 (mean)
                                 86.id           =    .0088496 (mean)
                                 87.id           =    .0088496 (mean)
                                 88.id           =    .0088496 (mean)
                                 89.id           =    .0088496 (mean)
                                 90.id           =    .0088496 (mean)
                                 91.id           =    .0088496 (mean)
                                 92.id           =    .0088496 (mean)
                                 93.id           =    .0088496 (mean)
                                 94.id           =    .0088496 (mean)
                                 95.id           =    .0088496 (mean)
                                 96.id           =    .0088496 (mean)
                                 97.id           =    .0088496 (mean)
                                 98.id           =    .0088496 (mean)
                                 99.id           =    .0088496 (mean)
                                 100.id          =    .0088496 (mean)
                                 101.id          =    .0088496 (mean)
                                 102.id          =    .0088496 (mean)
                                 103.id          =    .0088496 (mean)
                                 104.id          =    .0088496 (mean)
                                 105.id          =    .0088496 (mean)
                                 106.id          =    .0088496 (mean)
                                 107.id          =    .0088496 (mean)
                                 108.id          =    .0088496 (mean)
                                 109.id          =    .0088496 (mean)
                                 110.id          =    .0088496 (mean)
                                 111.id          =    .0088496 (mean)
                                 112.id          =    .0088496 (mean)
                                 113.id          =    .0088496 (mean)
                                 114.id          =    .0088496 (mean)
                                 115.id          =    .0088496 (mean)
                                 21960.date      =    .0076923 (mean)
                                 21961.date      =    .0076923 (mean)
                                 21962.date      =    .0076923 (mean)
                                 21963.date      =    .0076923 (mean)
                                 21964.date      =    .0076923 (mean)
                                 21965.date      =    .0076923 (mean)
                                 21966.date      =    .0076923 (mean)
                                 21967.date      =    .0076923 (mean)
                                 21968.date      =    .0076923 (mean)
                                 21969.date      =    .0076923 (mean)
                                 21970.date      =    .0076923 (mean)
                                 21971.date      =    .0076923 (mean)
                                 21972.date      =    .0076923 (mean)
                                 21973.date      =    .0076923 (mean)
                                 21974.date      =    .0076923 (mean)
                                 21975.date      =    .0076923 (mean)
                                 21976.date      =    .0076923 (mean)
                                 21977.date      =    .0076923 (mean)
                                 21978.date      =    .0076923 (mean)
                                 21979.date      =    .0076923 (mean)
                                 21980.date      =    .0076923 (mean)
                                 21981.date      =    .0076923 (mean)
                                 21982.date      =    .0076923 (mean)
                                 21983.date      =    .0076923 (mean)
                                 21984.date      =    .0076923 (mean)
                                 21985.date      =    .0076923 (mean)
                                 21986.date      =    .0076923 (mean)
                                 21987.date      =    .0076923 (mean)
                                 21988.date      =    .0076923 (mean)
                                 21989.date      =    .0076923 (mean)
                                 21990.date      =    .0076923 (mean)
                                 21991.date      =    .0076923 (mean)
                                 21992.date      =    .0076923 (mean)
                                 21993.date      =    .0076923 (mean)
                                 21994.date      =    .0076923 (mean)
                                 21995.date      =    .0076923 (mean)
                                 21996.date      =    .0076923 (mean)
                                 21997.date      =    .0076923 (mean)
                                 21998.date      =    .0076923 (mean)
                                 21999.date      =    .0076923 (mean)
                                 22000.date      =    .0076923 (mean)
                                 22001.date      =    .0076923 (mean)
                                 22002.date      =    .0076923 (mean)
                                 22003.date      =    .0076923 (mean)
                                 22004.date      =    .0076923 (mean)
                                 22005.date      =    .0076923 (mean)
                                 22006.date      =    .0076923 (mean)
                                 22007.date      =    .0076923 (mean)
                                 22008.date      =    .0076923 (mean)
                                 22009.date      =    .0076923 (mean)
                                 22010.date      =    .0076923 (mean)
                                 22011.date      =    .0076923 (mean)
                                 22012.date      =    .0076923 (mean)
                                 22013.date      =    .0076923 (mean)
                                 22014.date      =    .0076923 (mean)
                                 22015.date      =    .0076923 (mean)
                                 22016.date      =    .0076923 (mean)
                                 22017.date      =    .0076923 (mean)
                                 22018.date      =    .0076923 (mean)
                                 22019.date      =    .0076923 (mean)
                                 22020.date      =    .0076923 (mean)
                                 22021.date      =    .0076923 (mean)
                                 22022.date      =    .0076923 (mean)
                                 22023.date      =    .0076923 (mean)
                                 22024.date      =    .0076923 (mean)
                                 22025.date      =    .0076923 (mean)
                                 22026.date      =    .0076923 (mean)
                                 22027.date      =    .0076923 (mean)
                                 22028.date      =    .0076923 (mean)
                                 22029.date      =    .0076923 (mean)
                                 22030.date      =    .0076923 (mean)
                                 22031.date      =    .0076923 (mean)
                                 22032.date      =    .0076923 (mean)
                                 22033.date      =    .0076923 (mean)
                                 22034.date      =    .0076923 (mean)
                                 22035.date      =    .0076923 (mean)
                                 22036.date      =    .0076923 (mean)
                                 22037.date      =    .0076923 (mean)
                                 22038.date      =    .0076923 (mean)
                                 22039.date      =    .0076923 (mean)
                                 22040.date      =    .0076923 (mean)
                                 22041.date      =    .0076923 (mean)
                                 22042.date      =    .0076923 (mean)
                                 22043.date      =    .0076923 (mean)
                                 22044.date      =    .0076923 (mean)
                                 22045.date      =    .0076923 (mean)
                                 22046.date      =    .0076923 (mean)
                                 22047.date      =    .0076923 (mean)
                                 22048.date      =    .0076923 (mean)
                                 22049.date      =    .0076923 (mean)
                                 22050.date      =    .0076923 (mean)
                                 22051.date      =    .0076923 (mean)
                                 22052.date      =    .0076923 (mean)
                                 22053.date      =    .0076923 (mean)
                                 22054.date      =    .0076923 (mean)
                                 22055.date      =    .0076923 (mean)
                                 22056.date      =    .0076923 (mean)
                                 22057.date      =    .0076923 (mean)
                                 22058.date      =    .0076923 (mean)
                                 22059.date      =    .0076923 (mean)
                                 22060.date      =    .0076923 (mean)
                                 22061.date      =    .0076923 (mean)
                                 22062.date      =    .0076923 (mean)
                                 22063.date      =    .0076923 (mean)
                                 22064.date      =    .0076923 (mean)
                                 22065.date      =    .0076923 (mean)
                                 22066.date      =    .0076923 (mean)
                                 22067.date      =    .0076923 (mean)
                                 22068.date      =    .0076923 (mean)
                                 22069.date      =    .0076923 (mean)
                                 22070.date      =    .0076923 (mean)
                                 22071.date      =    .0076923 (mean)
                                 22072.date      =    .0076923 (mean)
                                 22073.date      =    .0076923 (mean)
                                 22074.date      =    .0076923 (mean)
                                 22075.date      =    .0076923 (mean)
                                 22076.date      =    .0076923 (mean)
                                 22077.date      =    .0076923 (mean)
                                 22078.date      =    .0076923 (mean)
                                 22079.date      =    .0076923 (mean)
                                 22080.date      =    .0076923 (mean)
                                 22081.date      =    .0076923 (mean)
                                 22082.date      =    .0076923 (mean)
                                 22083.date      =    .0076923 (mean)
                                 22084.date      =    .0076923 (mean)
                                 22085.date      =    .0076923 (mean)
                                 22086.date      =    .0076923 (mean)
                                 22087.date      =    .0076923 (mean)
                                 22088.date      =    .0076923 (mean)
                                 22089.date      =    .0076923 (mean)
                   
                  ---------------------------------------------------------------------------------
                                  |            Delta-method
                                  |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  ----------------+----------------------------------------------------------------
                  income_cat#post |
                             1 0  |          .  (not estimable)
                             1 1  |          .  (not estimable)
                             2 0  |          .  (not estimable)
                             2 1  |          .  (not estimable)
                             3 0  |          .  (not estimable)
                             3 1  |          .  (not estimable)
                             4 0  |          .  (not estimable)
                             4 1  |          .  (not estimable)
                  --------------------------------------------------------------------------------

                  Comment


                  • #10
                    Your regression is drastically overloaded with variables. You do not show your -xtset- command, but from the -xtreg- output, I can infer that you used id as the panel variable. You then ran a random effects regression, but also included i.id as a variable (that's a big no-no), and on top of that you threw in indicator for every date! You absolutely need to remove i.id from the variable list. (Or, if your intent is to run a fixed effects regression, specify the -fe- option--for which you should still remove i.id, but if you forget to do so Stata will in that case do it for you.)

                    But your first problem is to determine whether you want a fixed-effects model or a random-effects model. If this is to be a difference-in-differences analysis of a policy change, you almost certainly need a fixed-effects model.That would look something like:

                    Code:
                    xtset id
                    xtreg workplace i.post##ib4.income_cat  i.date /*other appropriate covariates*/, fe vce(cluster id)
                    If -margins- does not find things estimable following that model it will likely be due to some colinearities in your data, and various messages in the -xtreg- output will give you some hints about what variables might be involved.

                    Comment

                    Working...
                    X