Announcement

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

  • GLM for grouped/ blocked population standardized binary data.

    Sorry for imposing further but I could really use some help. Let me explain more.

    I have data on incidences of poisonings in each of the 50 US states by quarter for 26 quarters. Each poisoning could result in one of
    2 outcomes - no/ minor adverse medical outcome [outcome==1] or severe adverse medical outcome [outcome=2]. So the outcome is essentially binary - outcome 1 or outcome 2
    . I
    want to evaluate the impact of a certain government policy adopted by a subset of states [identified in the data below with variable treated==1] poisonings.
    I also have, separately from the US Census, the population of each state (variable 'pop' below). My data looks as follows:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str5 state float qtr long poisonings float(total poisonings_popstd outcome post) byte treated long pop float(x1 x2 x3 x4 x5 x6)
    "AK"  1  20  27  2.769937 1 0 1  722038  7.733333 27.7  4.545096 28.878407 .52014977 .08111796
    "AK"  1   7  27  .9694781 2 0 1  722038  7.733333 27.7  4.545096 28.878407 .52014977 .08111796
    "AK"  2  20  29  2.769937 1 0 1  722038  7.566667 27.7  4.545096 28.878407 .52014977 .08111796
    "AK"  2   9  29 1.2464718 2 0 1  722038  7.566667 27.7  4.545096 28.878407 .52014977 .08111796
    "AK"  3  27  35 3.7394154 1 0 1  722038       7.5 27.7  4.545096 28.878407 .52014977 .08111796
    "AK"  3   8  35 1.1079749 2 0 1  722038       7.5 27.7  4.545096 28.878407 .52014977 .08111796
    "AK"  4  18  32 2.4929435 1 0 1  722038  7.466667 27.7  4.545096 28.878407 .52014977 .08111796
    "AK"  4  14  32  1.938956 2 0 1  722038  7.466667 27.7  4.545096 28.878407 .52014977 .08111796
    "AK"  5  11  26  1.506026 2 0 1  730399  7.333333 27.7 4.6983337  29.19467  .5209735  .0854725
    "AK"  5  15  26  2.053672 1 0 1  730399  7.333333 27.7 4.6983337  29.19467  .5209735  .0854725
    "AK"  6   6  29  .8214688 2 0 1  730399  7.166667 27.7 4.6983337  29.19467  .5209735  .0854725
    "AK"  6  23  29  3.148964 1 0 1  730399  7.166667 27.7 4.6983337  29.19467  .5209735  .0854725
    "AK"  7  13  17  1.779849 1 0 1  730399  7.033333 27.7 4.6983337  29.19467  .5209735  .0854725
    "AK"  7   4  17 .54764587 2 0 1  730399  7.033333 27.7 4.6983337  29.19467  .5209735  .0854725
    "AK"  8  18  23 2.4644065 1 0 1  730399         7 27.7 4.6983337  29.19467  .5209735  .0854725
    "AK"  8   5  23  .6845573 2 0 1  730399         7 27.7 4.6983337  29.19467  .5209735  .0854725
    "AK"  9  16  18 2.1708307 1 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587
    "AK"  9   2  18 .27135384 2 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587
    "AK" 10  10  19 1.3567692 2 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587
    "AK" 10   9  19 1.2210923 1 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587
    "AK" 11  18  24  2.442185 1 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587
    "AK" 11   6  24  .8140616 2 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587
    "AK" 12  18  28  2.442185 1 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587
    "AK" 12  10  28 1.3567692 2 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587
    "AK" 13   7  12  .9506904 1 0 1  736307         7 27.7  4.795406    29.827  .5233248 .09415574
    "AK" 13   5  12  .6790646 2 0 1  736307         7 27.7  4.795406    29.827  .5233248 .09415574
    "AK" 14  16  24 2.1730065 1 0 1  736307         7 27.7  4.795406    29.827  .5233248 .09415574
    "AK" 14   8  24 1.0865033 2 0 1  736307         7 27.7  4.795406    29.827  .5233248 .09415574
    "AK" 15  18  24 2.4446325 1 0 1  736307  6.866667 27.7  4.795406    29.827  .5233248 .09415574
    "AK" 15   6  24  .8148775 2 0 1  736307  6.866667 27.7  4.795406    29.827  .5233248 .09415574
    "AK" 16  16  25 2.1730065 1 0 1  736307       6.6 27.7  4.795406    29.827  .5233248 .09415574
    "AK" 16   9  25 1.2223163 2 0 1  736307       6.6 27.7  4.795406    29.827  .5233248 .09415574
    "AK" 17  23  29 3.1184454 1 0 1  737547       6.5 27.7  4.818702  30.10442  .5234001 .09878014
    "AK" 17   6  29  .8135075 2 0 1  737547       6.5 27.7  4.818702  30.10442  .5234001 .09878014
    "AK" 18  12  27  1.627015 1 0 1  737547       6.5 27.7  4.818702  30.10442  .5234001 .09878014
    "AK" 18  15  27 2.0337687 2 0 1  737547       6.5 27.7  4.818702  30.10442  .5234001 .09878014
    "AK" 19   6  13  .8135075 2 0 1  737547       6.5 27.7  4.818702  30.10442  .5234001 .09878014
    "AK" 19   7  13   .949092 1 0 1  737547       6.5 27.7  4.818702  30.10442  .5234001 .09878014
    "AK" 20   3  23 .40675375 2 0 1  737547  6.633333 27.7  4.818702  30.10442  .5234001 .09878014
    "AK" 20  20  23 2.7116916 1 0 1  737547  6.633333 27.7  4.818702  30.10442  .5234001 .09878014
    "AK" 21  19  31   2.56236 1 0 1  741504  6.766667 27.7  4.911483  30.41499  .5231637 .10406608
    "AK" 21  12  31 1.6183325 2 0 1  741504  6.766667 27.7  4.911483  30.41499  .5231637 .10406608
    "AK" 22   8  18 1.0788883 2 0 1  741504  6.866667 27.7  4.911483  30.41499  .5231637 .10406608
    "AK" 22  10  18 1.3486104 1 0 1  741504  6.866667 27.7  4.911483  30.41499  .5231637 .10406608
    "AK" 23   5  27  .6743052 2 0 1  741504         7 27.7  4.911483  30.41499  .5231637 .10406608
    "AK" 23  22  27  2.966943 1 0 1  741504         7 27.7  4.911483  30.41499  .5231637 .10406608
    "AK" 24   9  20 1.2137494 2 0 1  741504         7 27.7  4.911483  30.41499  .5231637 .10406608
    "AK" 24  11  20 1.4834714 1 0 1  741504         7 27.7  4.911483  30.41499  .5231637 .10406608
    "AK" 25  16  26 2.1627877 1 0 1  739786  7.033333 27.7         .         .         .         .
    "AK" 25  10  26 1.3517423 2 0 1  739786  7.033333 27.7         .         .         .         .
    "AK" 26  20  31 2.7034845 1 0 1  739786  7.133333 27.7         .         .         .         .
    "AK" 26  11  31 1.4869165 2 0 1  739786  7.133333 27.7         .         .         .         .
    "AL"  1 127 191  2.646476 1 0 0 4798834 10.166667   31 26.847376   28.9922  .4852006 .14009614
    "AL"  1  64 191 1.3336573 2 0 0 4798834 10.166667   31 26.847376   28.9922  .4852006 .14009614
    "AL"  2 120 183 2.5006075 1 0 0 4798834        10   31 26.847376   28.9922  .4852006 .14009614
    "AL"  2  63 183  1.312819 2 0 0 4798834        10   31 26.847376   28.9922  .4852006 .14009614
    "AL"  3  62 172 1.2919805 2 0 0 4798834  9.666667   31 26.847376   28.9922  .4852006 .14009614
    "AL"  3 110 172 2.2922235 1 0 0 4798834  9.666667   31 26.847376   28.9922  .4852006 .14009614
    "AL"  4  52 161 1.0835966 2 0 0 4798834  8.633333   31 26.847376   28.9922  .4852006 .14009614
    "AL"  4 109 161 2.2713852 1 0 0 4798834  8.633333   31 26.847376   28.9922  .4852006 .14009614
    "AL"  5  66 171  1.370556 2 0 0 4815564         8   31 26.951054  29.14335  .4851257 .14522338
    "AL"  5 105 171   2.18043 1 0 0 4815564         8   31 26.951054  29.14335  .4851257 .14522338
    "AL"  6  65 198   1.34979 2 0 0 4815564       8.2   31 26.951054  29.14335  .4851257 .14522338
    "AL"  6 133 198  2.761878 1 0 0 4815564       8.2   31 26.951054  29.14335  .4851257 .14522338
    "AL"  7 127 202  2.637282 1 0 0 4815564  8.066667   31 26.951054  29.14335  .4851257 .14522338
    "AL"  7  75 202   1.55745 2 0 0 4815564  8.066667   31 26.951054  29.14335  .4851257 .14522338
    "AL"  8 123 196  2.554218 1 0 0 4815564  7.666667   31 26.951054  29.14335  .4851257 .14522338
    "AL"  8  73 196  1.515918 2 0 0 4815564  7.666667   31 26.951054  29.14335  .4851257 .14522338
    "AL"  9 128 193  2.649851 1 0 0 4830460       7.4   31 27.068136 29.300863  .4850109 .14920263
    "AL"  9  65 193 1.3456275 2 0 0 4830460       7.4   31 27.068136 29.300863  .4850109 .14920263
    "AL" 10 104 168 2.1530042 1 0 0 4830460       7.1   31 27.068136 29.300863  .4850109 .14920263
    "AL" 10  64 168 1.3249255 2 0 0 4830460       7.1   31 27.068136 29.300863  .4850109 .14920263
    "AL" 11  62 169 1.2835217 2 0 0 4830460  7.133333   31 27.068136 29.300863  .4850109 .14920263
    "AL" 11 107 169   2.21511 1 0 0 4830460  7.133333   31 27.068136 29.300863  .4850109 .14920263
    "AL" 12  93 170 1.9252825 1 0 0 4830460  7.233333   31 27.068136 29.300863  .4850109 .14920263
    "AL" 12  77 170  1.594051 2 0 0 4830460  7.233333   31 27.068136 29.300863  .4850109 .14920263
    "AL" 13  87 160 1.7965997 1 0 0 4842481  7.233333   31  27.15205 29.434875  .4848089 .15354267
    "AL" 13  73 160 1.5074917 2 0 0 4842481  7.233333   31  27.15205 29.434875  .4848089 .15354267
    "AL" 14  76 159 1.5694435 2 0 0 4842481         7   31  27.15205 29.434875  .4848089 .15354267
    "AL" 14  83 159 1.7139975 1 0 0 4842481         7   31  27.15205 29.434875  .4848089 .15354267
    "AL" 15  75 178  1.548793 2 0 0 4842481       6.6   31  27.15205 29.434875  .4848089 .15354267
    "AL" 15 103 178  2.127009 1 0 0 4842481       6.6   31  27.15205 29.434875  .4848089 .15354267
    "AL" 16  65 145 1.3422872 2 0 0 4842481  6.233333   31  27.15205 29.434875  .4848089 .15354267
    "AL" 16  80 145 1.6520457 1 0 0 4842481  6.233333   31  27.15205 29.434875  .4848089 .15354267
    "AL" 17  64 116 1.3187284 1 0 0 4853160       6.1   31  27.26294  29.60861   .484659  .1574272
    "AL" 17  52 116 1.0714668 2 0 0 4853160       6.1   31  27.26294  29.60861   .484659  .1574272
    "AL" 18  47 131  .9684412 2 0 0 4853160  6.166667   31  27.26294  29.60861   .484659  .1574272
    "AL" 18  84 131  1.730831 1 0 0 4853160  6.166667   31  27.26294  29.60861   .484659  .1574272
    "AL" 19  60 138  1.236308 2 0 0 4853160       6.1   31  27.26294  29.60861   .484659  .1574272
    "AL" 19  78 138 1.6072003 1 0 0 4853160       6.1   31  27.26294  29.60861   .484659  .1574272
    "AL" 20  61 139  1.256913 2 0 0 4853160         6   31  27.26294  29.60861   .484659  .1574272
    "AL" 20  78 139 1.6072003 1 0 0 4853160         6   31  27.26294  29.60861   .484659  .1574272
    "AL" 21  50 138 1.0278031 2 0 0 4864745  5.966667   31  27.34045 29.740936  .4843596  .1613207
    "AL" 21  88 138 1.8089335 1 0 0 4864745  5.966667   31  27.34045 29.740936  .4843596  .1613207
    "AL" 22  67 145  1.377256 2 0 0 4864745  5.833333   31  27.34045 29.740936  .4843596  .1613207
    "AL" 22  78 145 1.6033728 1 0 0 4864745  5.833333   31  27.34045 29.740936  .4843596  .1613207
    "AL" 23  70 124 1.4389243 1 0 0 4864745  5.833333   31  27.34045 29.740936  .4843596  .1613207
    "AL" 23  54 124 1.1100273 2 0 0 4864745  5.833333   31  27.34045 29.740936  .4843596  .1613207
    "AL" 24  85 134 1.7472652 1 0 0 4864745       5.8   31  27.34045 29.740936  .4843596  .1613207
    "AL" 24  49 134 1.0072471 2 0 0 4864745       5.8   31  27.34045 29.740936  .4843596  .1613207
    end

    My hypothesis is that the new state policies have reduced the number of poisonings resulting in minor/ no adverse medical outcome [outcome==1] and increased the rate of poisonings resulting in more severe adverse medical outcomes [outcome==2]. Since the outcome, at the individual level is essentially binary (result in outcome 1 or 2), I have been recommended a *blocked/ grouped* logit to test if the policy increased the probability of the worse outcomes and reduced the probability of the more minor adverse outcome [outcome==1]. For reasons of past literature, I included fixed effects for each state, quarter and state specific linear and quadratic time trends. I run the following:

    Code:
     glm poisonings post treated  x1 x2 x3 x4 x5 x6 state_share_rural_2010 md_100000 pa_1000
    > 00 rn_100000 i.qtr i.stateFIPS i.stateFIPS#(c.qtr c.qtrsq)  if outcome==2, family(binom
    > ial total) link(logit) vce(cluster state)
    note: 53.stateFIPS omitted because of collinearity
    note: 54.stateFIPS omitted because of collinearity
    note: 55.stateFIPS omitted because of collinearity
    note: 55.stateFIPS#c.qtr omitted because of collinearity
    note: 55.stateFIPS#c.qtrsq omitted because of collinearity
    
    Iteration 0:   log pseudolikelihood = -3591.7962 
    Iteration 1:   log pseudolikelihood = -3588.9357 
    Iteration 2:   log pseudolikelihood = -3588.9354 
    
    Generalized linear models                         No. of obs      =      1,128
    Optimization     : ML                             Residual df     =      1,097
                                                      Scale parameter =          1
    Deviance         =  1364.558325                   (1/df) Deviance =     1.2439
    Pearson          =  1350.134022                   (1/df) Pearson  =   1.230751
    
    Variance function: V(u) = u*(1-u/total)           [Binomial]
    Link function    : g(u) = ln(u/(total-u))         [Logit]
    
                                                      AIC             =   6.418325
    Log pseudolikelihood = -3588.935448               BIC             =  -6345.379
    
                                               (Std. Err. adjusted for 47 clusters in state)
    ----------------------------------------------------------------------------------------
                           |               Robust
                poisonings |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -----------------------+----------------------------------------------------------------
                      post |   .1280374   .0449471     2.85   0.004     .0399427    .2161321
                   treated |   9.455857   18.72428     0.51   0.614    -27.24306    46.15478
                        x1 |  -.0317194    .023618    -1.34   0.179    -.0780098     .014571
                        x2 |  -.5660772   1.021753    -0.55   0.580    -2.568676    1.436522
                        x3 |   .0800275   .5061473     0.16   0.874    -.9120029    1.072058
                        x4 |  -.0137807    .307849    -0.04   0.964    -.6171536    .5895922
                        x5 |   122.5292   101.0741     1.21   0.225    -75.57246    320.6308
                        x6 |   44.02676    24.5068     1.80   0.072    -4.005688     92.0592
    state_share_rural_2010 |  -10.30704   65.50204    -0.16   0.875    -138.6887    118.0746
                 md_100000 |  -.0520859    .094167    -0.55   0.580    -.2366498    .1324779
                 pa_100000 |   .0444265   .2285538     0.19   0.846    -.4035307    .4923837
                 rn_100000 |   .0143391   .0295121     0.49   0.627    -.0435036    .0721817
                           |
                       qtr |
                        2  |  -.0681311   .0350371    -1.94   0.052    -.1368026    .0005403
                        3  |  -.0792729   .0404783    -1.96   0.050    -.1586088    .0000631
                        4  |  -.1231814   .0446144    -2.76   0.006    -.2106239   -.0357388
                        5  |  -.3408823   .1485142    -2.30   0.022    -.6319648   -.0497997
                        6  |   -.376968    .152566    -2.47   0.013    -.6759919   -.0779441
                        7  |  -.3821582   .1491666    -2.56   0.010    -.6745193   -.0897971
                        8  |  -.4553765   .1579642    -2.88   0.004    -.7649807   -.1457722
                        9  |   -.593276   .2767458    -2.14   0.032    -1.135688   -.0508643
                       10  |  -.5681158   .2796033    -2.03   0.042    -1.116128   -.0201034
                       11  |  -.6535904   .2897996    -2.26   0.024    -1.221587   -.0855936
                       12  |  -.6966991   .2820733    -2.47   0.014    -1.249553   -.1438457
                       13  |  -.9303921   .4069777    -2.29   0.022    -1.728054   -.1327305
                       14  |  -.9062193   .4147891    -2.18   0.029    -1.719191   -.0932476
                       15  |  -.9076593   .4173466    -2.17   0.030    -1.725644    -.089675
                       16  |  -.8987763   .4118481    -2.18   0.029    -1.705984   -.0915689
                       17  |  -1.132076   .5379077    -2.10   0.035    -2.186356   -.0777966
                       18  |  -1.035746    .547678    -1.89   0.059    -2.109175    .0376827
                       19  |  -1.055255   .5546635    -1.90   0.057    -2.142376    .0318653
                       20  |  -1.113239   .5579486    -2.00   0.046    -2.206798   -.0196796
                       21  |   -1.26025   .6798281    -1.85   0.064    -2.592689    .0721882
                       22  |  -1.202498   .6817646    -1.76   0.078    -2.538732    .1337362
                       23  |  -1.181239   .6835069    -1.73   0.084    -2.520888    .1584101
                       24  |  -1.187128   .7014095    -1.69   0.091    -2.561865    .1876099
                           |
                 stateFIPS |
                        2  |  -8.947468   15.81543    -0.57   0.572    -39.94515    22.05021
                        4  |   -12.0106   25.66544    -0.47   0.640    -62.31393    38.29274
                        5  |  -6.085038   14.60429    -0.42   0.677    -34.70891    22.53884
                        6  |  -11.44933   26.53333    -0.43   0.666     -63.4537    40.55503
                        8  |  -3.529745   8.667129    -0.41   0.684    -20.51701    13.45752
                        9  |  -4.957952   18.50464    -0.27   0.789    -41.22638    31.31047
                       10  |  -9.679517   27.42826    -0.35   0.724    -63.43792    44.07889
                       12  |  -1.411309   12.39931    -0.11   0.909     -25.7135    22.89089
                       13  |  -8.957343   23.76524    -0.38   0.706    -55.53636    37.62167
                       15  |   2.410176   19.07879     0.13   0.899    -34.98357    39.80392
                       16  |   .5550814   5.612196     0.10   0.921    -10.44462    11.55478
                       17  |  -10.10562   27.64226    -0.37   0.715    -64.28347    44.07222
                       18  |  -7.997299   22.59134    -0.35   0.723    -52.27551    36.28091
                       19  |   1.256184   5.697489     0.22   0.825     -9.91069    12.42306
                       20  |  -2.694958   4.422801    -0.61   0.542    -11.36349    5.973572
                       21  |  -6.169956   13.26489    -0.47   0.642    -32.16867    19.82876
                       22  |  -6.391388   21.14652    -0.30   0.762     -47.8378    35.05502
                       23  |   4.271387   23.94119     0.18   0.858    -42.65247    51.19525
                       24  |  -6.223166   22.78421    -0.27   0.785    -50.87939    38.43306
                       25  |  -5.287871   21.46285    -0.25   0.805    -47.35428    36.77854
                       26  |   2.713903   4.803896     0.56   0.572     -6.70156    12.12937
                       27  |  -12.14202   22.93662    -0.53   0.597    -57.09697    32.81292
                       28  |  -.4793367     2.3538    -0.20   0.839      -5.0927    4.134027
                       29  |   1.934788   6.445643     0.30   0.764    -10.69844    14.56802
                       30  |   2.677419   18.53608     0.14   0.885    -33.65263    39.00747
                       31  |  -6.732864   10.03005    -0.67   0.502     -26.3914    12.92567
                       32  |   -9.16496   26.75222    -0.34   0.732    -61.59834    43.26842
                       33  |  -8.881691   14.92266    -0.60   0.552    -38.12956    20.36618
                       34  |  -5.947119   26.02535    -0.23   0.819    -56.95588    45.06164
                       35  |  -9.350599   18.14553    -0.52   0.606    -44.91518    26.21399
                       36  |  -4.148707   17.65852    -0.23   0.814    -38.75877    30.46136
                       37  |  -1.345194   4.815853    -0.28   0.780    -10.78409    8.093704
                       39  |  -6.138378   22.08242    -0.28   0.781    -49.41913    37.14237
                       40  |  -6.719478   15.08482    -0.45   0.656    -36.28517    22.84622
                       41  |   2.539168   3.731686     0.68   0.496    -4.774802    9.853138
                       42  |  -4.229331   16.34496    -0.26   0.796    -36.26487    27.80621
                       44  |  -6.861775   26.88413    -0.26   0.799     -59.5537    45.83015
                       45  |  -10.46153   20.59378    -0.51   0.611     -50.8246    29.90154
                       46  |  -10.28722   16.97919    -0.61   0.545    -43.56582    22.99138
                       47  |  -6.669694   18.00786    -0.37   0.711    -41.96446    28.62507
                       48  |  -10.08412   25.88989    -0.39   0.697    -60.82737    40.65912
                       49  |   -11.6419   27.24898    -0.43   0.669    -65.04893    41.76512
                       51  |  -8.827182   18.90776    -0.47   0.641    -45.88571    28.23135
                       53  |          0  (omitted)
                       54  |          0  (omitted)
                       55  |          0  (omitted)
                           |
           stateFIPS#c.qtr |
                        1  |   .0873125   .0090174     9.68   0.000     .0696387    .1049863
                        2  |   .0062401   .0516663     0.12   0.904    -.0950241    .1075043
                        4  |   .0232368   .0121039     1.92   0.055    -.0004864    .0469601
                        5  |  -.0140137   .0073818    -1.90   0.058    -.0284817    .0004543
                        6  |   .0474572   .0153308     3.10   0.002     .0174094    .0775051
                        8  |   .0428852   .0263179     1.63   0.103    -.0086969    .0944674
                        9  |   .0875877   .0138127     6.34   0.000     .0605154    .1146601
                       10  |   .0494902   .0226979     2.18   0.029     .0050031    .0939773
                       12  |  -.0365217   .0119252    -3.06   0.002    -.0598947   -.0131488
                       13  |  -.0292258   .0121902    -2.40   0.017    -.0531182   -.0053334
                       15  |  -.0103332   .0455048    -0.23   0.820    -.0995209    .0788545
                       16  |   .1305838   .0095613    13.66   0.000     .1118441    .1493235
                       17  |   .0688074   .0069859     9.85   0.000     .0551152    .0824995
                       18  |    .043609   .0060178     7.25   0.000     .0318142    .0554037
                       19  |   .0700069   .0107145     6.53   0.000     .0490069    .0910069
                       20  |   .0670102   .0134287     4.99   0.000     .0406904    .0933301
                       21  |  -.0177537   .0126121    -1.41   0.159     -.042473    .0069656
                       22  |   .1274598   .0128937     9.89   0.000     .1021886    .1527311
                       23  |   .1445257   .0190443     7.59   0.000     .1071996    .1818519
                       24  |   .0023594   .0252601     0.09   0.926    -.0471494    .0518682
                       25  |  -.0220327    .027342    -0.81   0.420    -.0756221    .0315566
                       26  |   .0698199    .008729     8.00   0.000     .0527114    .0869283
                       27  |   .0593758   .0098976     6.00   0.000     .0399768    .0787747
                       28  |   .0904343   .0075578    11.97   0.000     .0756213    .1052474
                       29  |   .0323497   .0063185     5.12   0.000     .0199657    .0447338
                       30  |   .0640228   .0149398     4.29   0.000     .0347413    .0933043
                       31  |   .1089145   .0132758     8.20   0.000     .0828945    .1349346
                       32  |   .0247509   .0193151     1.28   0.200     -.013106    .0626079
                       33  |   .0090151   .0174771     0.52   0.606    -.0252395    .0432696
                       34  |   .0532562   .0139683     3.81   0.000     .0258788    .0806335
                       35  |  -.0146453   .0179873    -0.81   0.416    -.0498997    .0206092
                       36  |  -.0012594   .0227893    -0.06   0.956    -.0459255    .0434068
                       37  |    .046556   .0144417     3.22   0.001     .0182508    .0748612
                       39  |   .0157902   .0124939     1.26   0.206    -.0086973    .0402778
                       40  |  -.0534207   .0100618    -5.31   0.000    -.0731415   -.0336999
                       41  |  -.0450526   .0146912    -3.07   0.002    -.0738469   -.0162583
                       42  |   .0743016   .0164902     4.51   0.000     .0419815    .1066217
                       44  |   .0563772   .0083841     6.72   0.000     .0399447    .0728098
                       45  |   .0279634   .0201218     1.39   0.165    -.0114745    .0674013
                       46  |   .1439447   .0710833     2.03   0.043     .0046241    .2832654
                       47  |   .0001434   .0143339     0.01   0.992    -.0279506    .0282374
                       48  |   .0460944   .0084858     5.43   0.000     .0294626    .0627262
                       49  |    .041073   .0182258     2.25   0.024      .005351     .076795
                       51  |   .0420577   .0182573     2.30   0.021     .0062741    .0778413
                       53  |   .0221912   .0212663     1.04   0.297    -.0194901    .0638724
                       54  |   .0086252   .0130878     0.66   0.510    -.0170265    .0342768
                       55  |          0  (omitted)
                           |
         stateFIPS#c.qtrsq |
                        1  |  -.0022872   .0003433    -6.66   0.000    -.0029602   -.0016143
                        2  |  -.0002177   .0014478    -0.15   0.880    -.0030554      .00262
                        4  |  -.0005262    .000264    -1.99   0.046    -.0010436   -8.80e-06
                        5  |   .0017617   .0002188     8.05   0.000     .0013329    .0021906
                        6  |   -.001821   .0002215    -8.22   0.000    -.0022551   -.0013869
                        8  |  -.0018612   .0003925    -4.74   0.000    -.0026304    -.001092
                        9  |  -.0024705    .000478    -5.17   0.000    -.0034074   -.0015336
                       10  |  -.0013925    .000395    -3.53   0.000    -.0021667   -.0006184
                       12  |   .0007492   .0004226     1.77   0.076     -.000079    .0015774
                       13  |   .0010488   .0003898     2.69   0.007     .0002848    .0018128
                       15  |   .0002051   .0008639     0.24   0.812    -.0014881    .0018982
                       16  |  -.0033215   .0002989   -11.11   0.000    -.0039074   -.0027357
                       17  |  -.0016999   .0001638   -10.38   0.000    -.0020209    -.001379
                       18  |  -.0006631   .0002067    -3.21   0.001    -.0010682   -.0002581
                       19  |  -.0012122   .0001109   -10.93   0.000    -.0014295   -.0009949
                       20  |  -.0016441    .000369    -4.46   0.000    -.0023673   -.0009209
                       21  |   .0005559   .0004014     1.39   0.166    -.0002307    .0013426
                       22  |  -.0024825   .0003398    -7.31   0.000    -.0031485   -.0018165
                       23  |  -.0048119   .0004619   -10.42   0.000    -.0057173   -.0039066
                       24  |  -.0003339   .0004897    -0.68   0.495    -.0012937    .0006259
                       25  |   .0006504   .0004045     1.61   0.108    -.0001424    .0014432
                       26  |   -.002681   .0001529   -17.54   0.000    -.0029806   -.0023814
                       27  |  -.0012435   .0002437    -5.10   0.000     -.001721   -.0007659
                       28  |  -.0027013    .000447    -6.04   0.000    -.0035775   -.0018251
                       29  |  -.0012331   .0002127    -5.80   0.000      -.00165   -.0008162
                       30  |  -.0023044   .0002618    -8.80   0.000    -.0028176   -.0017912
                       31  |  -.0026962   .0002079   -12.97   0.000    -.0031036   -.0022887
                       32  |  -.0007269   .0004593    -1.58   0.114    -.0016271    .0001734
                       33  |  -.0000602   .0003107    -0.19   0.846    -.0006691    .0005488
                       34  |  -.0017158   .0003741    -4.59   0.000    -.0024489   -.0009827
                       35  |   .0003067   .0004568     0.67   0.502    -.0005886     .001202
                       36  |  -.0001027   .0005236    -0.20   0.844    -.0011288    .0009235
                       37  |  -.0011671   .0003314    -3.52   0.000    -.0018166   -.0005176
                       39  |  -.0008741   .0003671    -2.38   0.017    -.0015936   -.0001547
                       40  |   .0007359   .0004954     1.49   0.137    -.0002351    .0017068
                       41  |   .0015358   .0006019     2.55   0.011      .000356    .0027156
                       42  |  -.0016836   .0003356    -5.02   0.000    -.0023413   -.0010259
                       44  |   -.001232   .0003575    -3.45   0.001    -.0019326   -.0005314
                       45  |   .0001419   .0004377     0.32   0.746     -.000716    .0009998
                       46  |  -.0039741   .0009312    -4.27   0.000    -.0057992    -.002149
                       47  |   .0006898   .0004325     1.59   0.111     -.000158    .0015376
                       48  |  -.0008588   .0002376    -3.61   0.000    -.0013245   -.0003931
                       49  |  -.0007886   .0004077    -1.93   0.053    -.0015876    .0000104
                       51  |   -.001024   .0004956    -2.07   0.039    -.0019953   -.0000526
                       53  |  -.0005743   .0004112    -1.40   0.163    -.0013802    .0002316
                       54  |  -.0010522   .0003709    -2.84   0.005    -.0017792   -.0003252
                       55  |          0  (omitted)
                           |
                     _cons |  -51.25055   47.68432    -1.07   0.282    -144.7101    42.20899
    ---------------------------------------------------------------------------------------
    However, ideally I want to run this on state-population normalized data [variable poisonings_popstd]
    that I got by
    converting the number of poisonings to rates of poisonings per 100,000 persons. Population standardized estimates are better to compare (changes in) rates across states with otherwise very different population sizes
    . How can I do that?

    I could really appreciate your help with this.

    Sincerely,
    Sumedha.

  • #2
    I'm not sure I understand what you are doing here. It doesn't make sense to me to use a logit link with a count outcome. Also, your regression model does not include any term for the treatment effect: the term treated simply represents a difference in outcome counts between the treated and untreated states at all times, irrespective of whether it is before or after the policy change.

    I think you would be better off using a Poisson (or possibly negataive binomial) model with population as the exposure., and you should do it conditionally, rather than unconditionally. I would also make use of factor variable notation. So I'm thinking of something like:

    Code:
     xtset stateFIPS
     xtpoisson poisonings i.post##i.treated  x1 x2 x3 x4 x5 x6 state_share_rural_2010 ///
        md_100000 pa_100000 rn_100000 i.qtr i.stateFIPS##c.qtr##c.qtr  if outcome==2, ///
        exposure(pop) vce(cluster stateFIPS)
    The coefficients will then represent population-based rates.

    The policy effect will be estimated by the coefficient of 1.post#1.treated in the outcome.

    By the way, it is a bit unusual to build into the model not only quadratic time trends, but separate quadratic time trends for each state. Is there some evidence supporting that approach? It's not out of the question, but it's a very complicated way to model time trends, and it soaks up a lot of degrees of freedom. Is that level of complexity really needed, or are you just overfitting the noise in the model?

    Finally, in the future, when posting example data with example code, please make them compatible with each other. The code you show cannot be run on the example you show because many of the variables in the regression command are not in the data.

    Comment


    • #3
      As always, thank you Prof. Schechter. Your input is to point and very helpful. I am sorry about the example data not corresponding to the example code. In an attempt to make it concise I messed up.

      Could I please request advise on another point? In the model above, how can I check if the impact of the policy change on the number of poisonings is mediated by an increase in poly-drug poisonings? For each state-quarter I also have information on the number of poly-drug poisonings, i.e. number of poisonings that included multiple substances. It looks like follows:

      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input str5 state float qtr long poisonings float(poisonings_popstd outcome post) byte treated long pop float(x1 x2 x3 x4 x5 x6 state_share_rural_2010 md_100000 pa_100000 rn_100000) long poly
      "AK"  2  20  2.769937 1 0 1  722038  7.566667 27.7  4.545096 28.878407 .52014977 .08111796 .3398058 272.16888 70.290695  915.4395  20
      "AK"  2   9 1.2464718 2 0 1  722038  7.566667 27.7  4.545096 28.878407 .52014977 .08111796 .3398058 272.16888 70.290695  915.4395   7
      "AK"  1   7  .9694781 2 0 1  722038  7.733333 27.7  4.545096 28.878407 .52014977 .08111796 .3398058 272.16888 70.290695  915.4395   7
      "AK"  3  27 3.7394154 1 0 1  722038       7.5 27.7  4.545096 28.878407 .52014977 .08111796 .3398058 272.16888 70.290695  915.4395  24
      "AK"  1  20  2.769937 1 0 1  722038  7.733333 27.7  4.545096 28.878407 .52014977 .08111796 .3398058 272.16888 70.290695  915.4395  18
      "AK"  4  18 2.4929435 1 0 1  722038  7.466667 27.7  4.545096 28.878407 .52014977 .08111796 .3398058 272.16888 70.290695  915.4395  18
      "AK"  3   8 1.1079749 2 0 1  722038       7.5 27.7  4.545096 28.878407 .52014977 .08111796 .3398058 272.16888 70.290695  915.4395   8
      "AK"  4  14  1.938956 2 0 1  722038  7.466667 27.7  4.545096 28.878407 .52014977 .08111796 .3398058 272.16888 70.290695  915.4395  14
      "AK"  6  23  3.148964 1 0 1  730399  7.166667 27.7 4.6983337  29.19467  .5209735  .0854725 .3398058  269.0507  69.48538  904.9514  22
      "AK"  6   6  .8214688 2 0 1  730399  7.166667 27.7 4.6983337  29.19467  .5209735  .0854725 .3398058  269.0507  69.48538  904.9514   5
      "AK"  5  15  2.053672 1 0 1  730399  7.333333 27.7 4.6983337  29.19467  .5209735  .0854725 .3398058  269.0507  69.48538  904.9514  14
      "AK"  7   4 .54764587 2 0 1  730399  7.033333 27.7 4.6983337  29.19467  .5209735  .0854725 .3398058  269.0507  69.48538  904.9514   4
      "AK"  8  18 2.4644065 1 0 1  730399         7 27.7 4.6983337  29.19467  .5209735  .0854725 .3398058  269.0507  69.48538  904.9514  16
      "AK"  8   5  .6845573 2 0 1  730399         7 27.7 4.6983337  29.19467  .5209735  .0854725 .3398058  269.0507  69.48538  904.9514   5
      "AK"  7  13  1.779849 1 0 1  730399  7.033333 27.7 4.6983337  29.19467  .5209735  .0854725 .3398058  269.0507  69.48538  904.9514  12
      "AK"  5  11  1.506026 2 0 1  730399  7.333333 27.7 4.6983337  29.19467  .5209735  .0854725 .3398058  269.0507  69.48538  904.9514  11
      "AK" 11  18  2.442185 1 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587 .3398058 266.93665  68.93941  897.8408  16
      "AK" 10  10 1.3567692 2 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587 .3398058 266.93665  68.93941  897.8408  10
      "AK"  9  16 2.1708307 1 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587 .3398058 266.93665  68.93941  897.8408  16
      "AK" 11   6  .8140616 2 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587 .3398058 266.93665  68.93941  897.8408   6
      "AK" 12  18  2.442185 1 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587 .3398058 266.93665  68.93941  897.8408  18
      "AK" 12  10 1.3567692 2 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587 .3398058 266.93665  68.93941  897.8408  10
      "AK" 10   9 1.2210923 1 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587 .3398058 266.93665  68.93941  897.8408   9
      "AK"  9   2 .27135384 2 0 1  737045         7 27.7  4.786403   29.4967  .5228226 .08950587 .3398058 266.93665  68.93941  897.8408   2
      "AK" 13   5  .6790646 2 0 1  736307         7 27.7  4.795406    29.827  .5233248 .09415574 .3398058  266.9997  68.95569  898.0528   5
      "AK" 14  16 2.1730065 1 0 1  736307         7 27.7  4.795406    29.827  .5233248 .09415574 .3398058  266.9997  68.95569  898.0528  14
      "AK" 16  16 2.1730065 1 0 1  736307       6.6 27.7  4.795406    29.827  .5233248 .09415574 .3398058  266.9997  68.95569  898.0528  14
      "AK" 15  18 2.4446325 1 0 1  736307  6.866667 27.7  4.795406    29.827  .5233248 .09415574 .3398058  266.9997  68.95569  898.0528  17
      "AK" 16   9 1.2223163 2 0 1  736307       6.6 27.7  4.795406    29.827  .5233248 .09415574 .3398058  266.9997  68.95569  898.0528   8
      "AK" 13   7  .9506904 1 0 1  736307         7 27.7  4.795406    29.827  .5233248 .09415574 .3398058  266.9997  68.95569  898.0528   7
      "AK" 14   8 1.0865033 2 0 1  736307         7 27.7  4.795406    29.827  .5233248 .09415574 .3398058  266.9997  68.95569  898.0528   8
      "AK" 15   6  .8148775 2 0 1  736307  6.866667 27.7  4.795406    29.827  .5233248 .09415574 .3398058  266.9997  68.95569  898.0528   5
      "AK" 20  20 2.7116916 1 0 1  737547  6.633333 27.7  4.818702  30.10442  .5234001 .09878014 .3398058  266.6363  68.86184  896.8306  20
      "AK" 19   7   .949092 1 0 1  737547       6.5 27.7  4.818702  30.10442  .5234001 .09878014 .3398058  266.6363  68.86184  896.8306   6
      "AK" 17   6  .8135075 2 0 1  737547       6.5 27.7  4.818702  30.10442  .5234001 .09878014 .3398058  266.6363  68.86184  896.8306   6
      "AK" 17  23 3.1184454 1 0 1  737547       6.5 27.7  4.818702  30.10442  .5234001 .09878014 .3398058  266.6363  68.86184  896.8306  23
      "AK" 19   6  .8135075 2 0 1  737547       6.5 27.7  4.818702  30.10442  .5234001 .09878014 .3398058  266.6363  68.86184  896.8306   6
      "AK" 18  15 2.0337687 2 0 1  737547       6.5 27.7  4.818702  30.10442  .5234001 .09878014 .3398058  266.6363  68.86184  896.8306  14
      "AK" 18  12  1.627015 1 0 1  737547       6.5 27.7  4.818702  30.10442  .5234001 .09878014 .3398058  266.6363  68.86184  896.8306  11
      "AK" 20   3 .40675375 2 0 1  737547  6.633333 27.7  4.818702  30.10442  .5234001 .09878014 .3398058  266.6363  68.86184  896.8306   3
      "AK" 22   8 1.0788883 2 0 1  741504  6.866667 27.7  4.911483  30.41499  .5231637 .10406608 .3398058  265.1322   68.4734  891.7716   8
      "AK" 24  11 1.4834714 1 0 1  741504         7 27.7  4.911483  30.41499  .5231637 .10406608 .3398058  265.1322   68.4734  891.7716   7
      "AK" 21  12 1.6183325 2 0 1  741504  6.766667 27.7  4.911483  30.41499  .5231637 .10406608 .3398058  265.1322   68.4734  891.7716  11
      "AK" 21  19   2.56236 1 0 1  741504  6.766667 27.7  4.911483  30.41499  .5231637 .10406608 .3398058  265.1322   68.4734  891.7716  18
      "AK" 23  22  2.966943 1 0 1  741504         7 27.7  4.911483  30.41499  .5231637 .10406608 .3398058  265.1322   68.4734  891.7716  20
      "AK" 24   9 1.2137494 2 0 1  741504         7 27.7  4.911483  30.41499  .5231637 .10406608 .3398058  265.1322   68.4734  891.7716   9
      "AK" 22  10 1.3486104 1 0 1  741504  6.866667 27.7  4.911483  30.41499  .5231637 .10406608 .3398058  265.1322   68.4734  891.7716   9
      "AK" 23   5  .6743052 2 0 1  741504         7 27.7  4.911483  30.41499  .5231637 .10406608 .3398058  265.1322   68.4734  891.7716   5
      "AK" 26  11 1.4869165 2 0 1  739786  7.133333 27.7         .         .         .         . .3398058  265.8877  68.66851  894.3127  11
      "AK" 25  10 1.3517423 2 0 1  739786  7.033333 27.7         .         .         .         . .3398058  265.8877  68.66851  894.3127   9
      "AK" 25  16 2.1627877 1 0 1  739786  7.033333 27.7         .         .         .         . .3398058  265.8877  68.66851  894.3127  15
      "AK" 26  20 2.7034845 1 0 1  739786  7.133333 27.7         .         .         .         . .3398058  265.8877  68.66851  894.3127  20
      "AL"  3  62 1.2919805 2 0 0 4798834  9.666667   31 26.847376   28.9922  .4852006 .14009614 .4096304  209.7536 29.958845 1025.8926  61
      "AL"  4 109 2.2713852 1 0 0 4798834  8.633333   31 26.847376   28.9922  .4852006 .14009614 .4096304  209.7536 29.958845 1025.8926  97
      "AL"  2  63  1.312819 2 0 0 4798834        10   31 26.847376   28.9922  .4852006 .14009614 .4096304  209.7536 29.958845 1025.8926  61
      "AL"  1  64 1.3336573 2 0 0 4798834 10.166667   31 26.847376   28.9922  .4852006 .14009614 .4096304  209.7536 29.958845 1025.8926  58
      "AL"  1 127  2.646476 1 0 0 4798834 10.166667   31 26.847376   28.9922  .4852006 .14009614 .4096304  209.7536 29.958845 1025.8926 111
      "AL"  2 120 2.5006075 1 0 0 4798834        10   31 26.847376   28.9922  .4852006 .14009614 .4096304  209.7536 29.958845 1025.8926 102
      "AL"  4  52 1.0835966 2 0 0 4798834  8.633333   31 26.847376   28.9922  .4852006 .14009614 .4096304  209.7536 29.958845 1025.8926  46
      "AL"  3 110 2.2922235 1 0 0 4798834  9.666667   31 26.847376   28.9922  .4852006 .14009614 .4096304  209.7536 29.958845 1025.8926 104
      "AL"  6  65   1.34979 2 0 0 4815564       8.2   31 26.951054  29.14335  .4851257 .14522338 .4096304  209.0549  29.85905 1022.4753  63
      "AL"  7  75   1.55745 2 0 0 4815564  8.066667   31 26.951054  29.14335  .4851257 .14522338 .4096304  209.0549  29.85905 1022.4753  72
      "AL"  5 105   2.18043 1 0 0 4815564         8   31 26.951054  29.14335  .4851257 .14522338 .4096304  209.0549  29.85905 1022.4753  92
      "AL"  8 123  2.554218 1 0 0 4815564  7.666667   31 26.951054  29.14335  .4851257 .14522338 .4096304  209.0549  29.85905 1022.4753 103
      "AL"  8  73  1.515918 2 0 0 4815564  7.666667   31 26.951054  29.14335  .4851257 .14522338 .4096304  209.0549  29.85905 1022.4753  71
      "AL"  5  66  1.370556 2 0 0 4815564         8   31 26.951054  29.14335  .4851257 .14522338 .4096304  209.0549  29.85905 1022.4753  59
      "AL"  6 133  2.761878 1 0 0 4815564       8.2   31 26.951054  29.14335  .4851257 .14522338 .4096304  209.0549  29.85905 1022.4753 111
      "AL"  7 127  2.637282 1 0 0 4815564  8.066667   31 26.951054  29.14335  .4851257 .14522338 .4096304  209.0549  29.85905 1022.4753 113
      "AL" 10  64 1.3249255 2 0 0 4830460       7.1   31 27.068136 29.300863  .4850109 .14920263 .4096304  208.4697  29.77547 1019.6131  61
      "AL" 11 107   2.21511 1 0 0 4830460  7.133333   31 27.068136 29.300863  .4850109 .14920263 .4096304  208.4697  29.77547 1019.6131  94
      "AL"  9  65 1.3456275 2 0 0 4830460       7.4   31 27.068136 29.300863  .4850109 .14920263 .4096304  208.4697  29.77547 1019.6131  59
      "AL" 11  62 1.2835217 2 0 0 4830460  7.133333   31 27.068136 29.300863  .4850109 .14920263 .4096304  208.4697  29.77547 1019.6131  59
      "AL"  9 128  2.649851 1 0 0 4830460       7.4   31 27.068136 29.300863  .4850109 .14920263 .4096304  208.4697  29.77547 1019.6131 105
      "AL" 12  93 1.9252825 1 0 0 4830460  7.233333   31 27.068136 29.300863  .4850109 .14920263 .4096304  208.4697  29.77547 1019.6131  76
      "AL" 10 104 2.1530042 1 0 0 4830460       7.1   31 27.068136 29.300863  .4850109 .14920263 .4096304  208.4697  29.77547 1019.6131  94
      "AL" 12  77  1.594051 2 0 0 4830460  7.233333   31 27.068136 29.300863  .4850109 .14920263 .4096304  208.4697  29.77547 1019.6131  76
      "AL" 13  87 1.7965997 1 0 0 4842481  7.233333   31  27.15205 29.434875  .4848089 .15354267 .4096304  207.8785 29.691027 1016.7216  68
      "AL" 16  80 1.6520457 1 0 0 4842481  6.233333   31  27.15205 29.434875  .4848089 .15354267 .4096304  207.8785 29.691027 1016.7216  66
      "AL" 15 103  2.127009 1 0 0 4842481       6.6   31  27.15205 29.434875  .4848089 .15354267 .4096304  207.8785 29.691027 1016.7216  97
      "AL" 15  75  1.548793 2 0 0 4842481       6.6   31  27.15205 29.434875  .4848089 .15354267 .4096304  207.8785 29.691027 1016.7216  74
      "AL" 14  83 1.7139975 1 0 0 4842481         7   31  27.15205 29.434875  .4848089 .15354267 .4096304  207.8785 29.691027 1016.7216  73
      "AL" 13  73 1.5074917 2 0 0 4842481  7.233333   31  27.15205 29.434875  .4848089 .15354267 .4096304  207.8785 29.691027 1016.7216  69
      "AL" 14  76 1.5694435 2 0 0 4842481         7   31  27.15205 29.434875  .4848089 .15354267 .4096304  207.8785 29.691027 1016.7216  74
      "AL" 16  65 1.3422872 2 0 0 4842481  6.233333   31  27.15205 29.434875  .4848089 .15354267 .4096304  207.8785 29.691027 1016.7216  63
      "AL" 20  78 1.6072003 1 0 0 4853160         6   31  27.26294  29.60861   .484659  .1574272 .4096304  207.4219 29.625814 1014.4884  69
      "AL" 17  64 1.3187284 1 0 0 4853160       6.1   31  27.26294  29.60861   .484659  .1574272 .4096304  207.4219 29.625814 1014.4884  55
      "AL" 17  52 1.0714668 2 0 0 4853160       6.1   31  27.26294  29.60861   .484659  .1574272 .4096304  207.4219 29.625814 1014.4884  52
      "AL" 19  78 1.6072003 1 0 0 4853160       6.1   31  27.26294  29.60861   .484659  .1574272 .4096304  207.4219 29.625814 1014.4884  72
      "AL" 18  47  .9684412 2 0 0 4853160  6.166667   31  27.26294  29.60861   .484659  .1574272 .4096304  207.4219 29.625814 1014.4884  44
      "AL" 18  84  1.730831 1 0 0 4853160  6.166667   31  27.26294  29.60861   .484659  .1574272 .4096304  207.4219 29.625814 1014.4884  77
      "AL" 19  60  1.236308 2 0 0 4853160       6.1   31  27.26294  29.60861   .484659  .1574272 .4096304  207.4219 29.625814 1014.4884  59
      "AL" 20  61  1.256913 2 0 0 4853160         6   31  27.26294  29.60861   .484659  .1574272 .4096304  207.4219 29.625814 1014.4884  59
      "AL" 23  54 1.1100273 2 0 0 4864745  5.833333   31  27.34045 29.740936  .4843596  .1613207 .4096304 207.01993   29.5684 1012.5223  52
      "AL" 22  78 1.6033728 1 0 0 4864745  5.833333   31  27.34045 29.740936  .4843596  .1613207 .4096304 207.01993   29.5684 1012.5223  71
      "AL" 21  50 1.0278031 2 0 0 4864745  5.966667   31  27.34045 29.740936  .4843596  .1613207 .4096304 207.01993   29.5684 1012.5223  48
      "AL" 21  88 1.8089335 1 0 0 4864745  5.966667   31  27.34045 29.740936  .4843596  .1613207 .4096304 207.01993   29.5684 1012.5223  79
      "AL" 24  49 1.0072471 2 0 0 4864745       5.8   31  27.34045 29.740936  .4843596  .1613207 .4096304 207.01993   29.5684 1012.5223  47
      "AL" 23  70 1.4389243 1 0 0 4864745  5.833333   31  27.34045 29.740936  .4843596  .1613207 .4096304 207.01993   29.5684 1012.5223  62
      "AL" 24  85 1.7472652 1 0 0 4864745       5.8   31  27.34045 29.740936  .4843596  .1613207 .4096304 207.01993   29.5684 1012.5223  75
      "AL" 22  67  1.377256 2 0 0 4864745  5.833333   31  27.34045 29.740936  .4843596  .1613207 .4096304 207.01993   29.5684 1012.5223  65
      end

      I want to check if the increase in poly-drug poisonings is driving the increase in more severe outcomes [outcome==2] following treatment. How can I check for that? Is there a specific *mediation* model I can use or an interaction term I should include?

      Thank you again Prof. Schechter. I am very grateful.

      Sincerely,
      Sumedha.

      Comment


      • #4
        So, first, let's be clear about our terminology. Mediation and moderation are very different. Interaction terms are not useful for the assessment of mediation, but they are more or less the sine qua non of moderation. From your description of the problem it seems to me that you are interested in assessing mediation here.

        I am very reluctant to advise you on how to explore mediation. There are divergent schools of thought about this, and, in my experience, they tend to hold to their beliefs in a highly dogmatic and intolerant way. (This includes one school of thought that holds that mediation cannot even be studied at all in observational data.) I do not know what context you are working in. But if you are a student, you should ask your advisor which approach they favor. If you are doing this for an employer, ask your supervisor/manager. If you are an academic and hope to publish, look for other articles about mediation in the journal you are targeting and see what they do.

        Once you have settled on the overall approach you should use, feel free to come back for help with coding it.

        Comment


        • #5
          Dear Prof. Schechter,

          Thank you for your advise. Per your advise I tried to estimate a fixed-effect negative binomial count model, but no luck. Specifically, I ran:

          Code:
          xtset stateFIPS xtnbreg poisonings i.post##i.treated x1 x2 x3 x4 x5 x6 state_share_rural_2010 /// md_100000 pa_100000 rn_100000 i.qtr i.stateFIPS##c.qtr##c.qtr if outcome==2, /// exposure(pop) vce(cluster stateFIPS)
          note: 51.stateFIPS omitted because of collinearity note: 53.stateFIPS omitted because of collinearity note: 54.stateFIPS omitted because of collinearity note: 55.stateFIPS omitted because of collinearity note: 55.stateFIPS#c.qtr omitted because of collinearity note: 55.stateFIPS#c.qtrsq omitted because of collinearity Fitting negative binomial (constant dispersion) model: Iteration 0: log likelihood = -6185.0268 Iteration 1: log likelihood = -3858.2938 Iteration 2: log likelihood = -3845.988 Iteration 3: log likelihood = -3845.9761 Iteration 4: log likelihood = -3845.9761 Iteration 0: log likelihood = -6851.2913 Iteration 1: log likelihood = -6256.026 Iteration 2: log likelihood = -6165.3081 Iteration 3: log likelihood = -5188.9244 Iteration 4: log likelihood = -5136.6589 Iteration 5: log likelihood = -5135.4738 Iteration 6: log likelihood = -5135.4735 Iteration 0: log likelihood = -5135.4735 (not concave) Iteration 1: log likelihood = -4769.9803 (not concave) Iteration 2: log likelihood = -4340.4408 (not concave) Iteration 3: log likelihood = -4151.4882 (not concave) Iteration 4: log likelihood = -4078.6382 Iteration 5: log likelihood = -3961.4905 (backed up) Iteration 6: log likelihood = -3852.1876 (not concave) Iteration 7: log likelihood = -3836.8791 Iteration 8: log likelihood = -3826.5079 Iteration 9: log likelihood = -3826.4413 Iteration 10: log likelihood = -3826.4409 Fitting full model: Iteration 0: log likelihood = -4041.7221 Iteration 1: log likelihood = -3999.9149 (not concave) Iteration 2: log likelihood = -3927.6286 (not concave) Iteration 3: log likelihood = -3918.9653 (not concave) Iteration 4: log likelihood = -3915.2971 (not concave) Iteration 5: log likelihood = -3912.8659 (not concave) Iteration 6: log likelihood = -3910.5772 (not concave) Iteration 7: log likelihood = -3905.3535 (not concave) Iteration 8: log likelihood = -3900.0073 (not concave) Iteration 9: log likelihood = -3889.5348 (not concave) Iteration 10: log likelihood = -3881.12 (not concave) Iteration 11: log likelihood = -3878.871 (not concave) --Break--
          I stopped it because it does not converge due to non-concavity. Is there something I can change to help?

          Thank you Prof. Schechter.
          Sincerely,
          Sumedha.

          Comment


          • #6
            My first reaction is that you quit prematurely here. Stata was in a non-concave section of the likelihood, but it was still making progress. If you were getting the not concave message and the log likelihood were unchanging, that would be grounds for breaking the analysis. But that is not what happened here. Stata may well find its way out of the not concave section if you let it proceed. So I would go back and let it run longer. You have a complicated model (xtnbreg) and you have made it even more complicated by including many variables and interactions. This is not going to converge like a simple logistic regression.

            If ultimately, Stata cannot converge that model, then you need to simplify the model. The first thing I would do is remove i.qtr: you already have state-specific linear and quadratic terms for time in the model. Why do you need to add quarter-specific shocks. Even if your model converges, this looks excessive to me: you are probably just overfitting to the noise in the model. Next, I would simplify the time representation to just c.qtr##c.qtr without the state interaction.

            If you still can't get convergence, then I would start over from scratch and build the model up. Begin with a model containing only i.post##i.treated as predictors. Then add in the other variables one at a time, and keep going as long as you get convergence. When you add a new variable and it fails to converge, you know that variable is problematic and you have to omit it. You can go on trying to add other variables, and perhaps you will also identify some of them as problematic.

            Comment


            • #7
              Dear Prof. Schechter,

              Thank you again for your detailed response. The post variable is already an interaction between post_treatment_period*treated. Different states implement the policy at different times so this will be a generalized diff-in-diff. I have a concern... do we need to use xtnbreg? Or, since I am including dummies for pretty much everything, can I use nbreg instead and interpret the coefficient on the *post* as the diff-in-diff estimate? With nbreg I include the clustering at the state level as well.

              Thank you Prof. Schechter.

              Sincerely,
              Sumedha.

              Comment


              • #8
                You should use -xtnbreg-, and do not include indicators ("dummies") for the states (or, if they are generated automatically from interaction terms, Stata will drop them anyway). In linear regression the use of fixed-effects estimation and panel (state) indicators are equivalent. But for non-linear models such as the negative binomial they are not.

                Comment


                • #9
                  Thank you Prof. Schechter. Of course... the non-linearity. I ran xtnbreg but Stata did not drum the state indicators:

                  Code:
                   xtnbreg narc_nocod post treatMA  qavg_pct_lf_unemp pct_lhs pct_hs   perc_black perc_non
                  > white  pctmale pctover65  ///  // perfect
                  > state_share_rural_2010 md_100000 pa_100000 rn_100000 i.qtr i.stateFIPS /*i.stateFIPS#(c
                  > .qtr c.qtrsq)*/  if outcome==2, ///
                  >     exposure(popestimate) /*vce(cluster stateFIPS)*/
                  note: 51.stateFIPS omitted because of collinearity
                  note: 53.stateFIPS omitted because of collinearity
                  note: 54.stateFIPS omitted because of collinearity
                  note: 55.stateFIPS omitted because of collinearity
                  
                  Fitting negative binomial (constant dispersion) model:
                  
                  Iteration 0:   log likelihood = -6091.0078 
                  Iteration 1:   log likelihood = -4465.1232 
                  Iteration 2:   log likelihood = -4459.0171 
                  Iteration 3:   log likelihood = -4459.0147 
                  Iteration 4:   log likelihood = -4459.0147 
                  
                  Iteration 0:   log likelihood = -6851.2913 
                  Iteration 1:   log likelihood =  -6256.026 
                  Iteration 2:   log likelihood = -6165.3081 
                  Iteration 3:   log likelihood = -5188.9244 
                  Iteration 4:   log likelihood = -5136.6589 
                  Iteration 5:   log likelihood = -5135.4738 
                  Iteration 6:   log likelihood = -5135.4735 
                  
                  Iteration 0:   log likelihood = -5135.4735  (not concave)
                  Iteration 1:   log likelihood = -4783.5037  (not concave)
                  Iteration 2:   log likelihood = -4503.6509  (not concave)
                  Iteration 3:   log likelihood =  -4395.626 
                  Iteration 4:   log likelihood = -4277.2504 
                  Iteration 5:   log likelihood = -4178.7804 
                  Iteration 6:   log likelihood = -4172.1406 
                  Iteration 7:   log likelihood = -4172.1208 
                  Iteration 8:   log likelihood = -4172.1208 
                  
                  Fitting full model:
                  
                  Iteration 0:   log likelihood = -4345.4263  (not concave)
                  Iteration 1:   log likelihood = -4252.9349 
                  Iteration 2:   log likelihood = -4187.3206 
                  Iteration 3:   log likelihood = -4174.3509 
                  Iteration 4:   log likelihood = -4173.7729 
                  Iteration 5:   log likelihood = -4173.7687 
                  Iteration 6:   log likelihood = -4173.7687 
                  
                  Random-effects negative binomial regression     Number of obs     =      1,128
                  Group variable: stateFIPS                       Number of groups  =         47
                  
                  Random effects u_i ~ Beta                       Obs per group:
                                                                                min =         24
                                                                                avg =       24.0
                                                                                max =         24
                  
                                                                  Wald chi2(78)     =     376.29
                  Log likelihood  = -4173.7687                    Prob > chi2       =     0.0000
                  
                  ----------------------------------------------------------------------------------------
                              narc_nocod |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  -----------------------+----------------------------------------------------------------
                                    post |   .0080413   .0271216     0.30   0.767     -.045116    .0611986
                                 treatMA |  -1.444742   .8773379    -1.65   0.100    -3.164293    .2748086
                       qavg_pct_lf_unemp |    .023564   .0136388     1.73   0.084    -.0031676    .0502956
                                 pct_lhs |  -1.410853   .8685141    -1.62   0.104     -3.11311    .2914032
                                  pct_hs |  -1.678644   .7842991    -2.14   0.032    -3.215842    -.141446
                              perc_black |   .0288197   .1004643     0.29   0.774    -.1680867    .2257262
                           perc_nonwhite |  -.1138498   .0769788    -1.48   0.139    -.2647255    .0370258
                                 pctmale |   3.336456   23.16864     0.14   0.885    -42.07325    48.74616
                               pctover65 |   5.815132   6.313151     0.92   0.357    -6.558417    18.18868
                  state_share_rural_2010 |   112.0778   54.89722     2.04   0.041     4.481231    219.6744
                               md_100000 |   .0258052   .0120126     2.15   0.032      .002261    .0493494
                               pa_100000 |   .0459033    .050429     0.91   0.363    -.0529358    .1447424
                               rn_100000 |  -.0078957   .0038619    -2.04   0.041    -.0154649   -.0003266
                                         |
                                     qtr |
                                      2  |  -.0032739   .0376902    -0.09   0.931    -.0771454    .0705975
                                      3  |   .0415494   .0376314     1.10   0.270    -.0322068    .1153056
                                      4  |  -.0188487   .0389242    -0.48   0.628    -.0951389    .0574414
                                      5  |   .0497545   .0562474     0.88   0.376    -.0604883    .1599973
                                      6  |    .014698   .0581768     0.25   0.801    -.0993265    .1287224
                                      7  |   .0222288   .0583595     0.38   0.703    -.0921537    .1366113
                                      8  |  -.0034189   .0597087    -0.06   0.954    -.1204458    .1136079
                                      9  |   -.002345   .0856728    -0.03   0.978    -.1702605    .1655706
                                     10  |    .030556   .0866132     0.35   0.724    -.1392027    .2003147
                                     11  |   .0317225   .0888136     0.36   0.721    -.1423489    .2057939
                                     12  |  -.0212652   .0914413    -0.23   0.816    -.2004869    .1579566
                                     13  |  -.0469652   .1210525    -0.39   0.698    -.2842237    .1902933
                                     14  |  -.0220399   .1216871    -0.18   0.856    -.2605422    .2164624
                                     15  |   .0190654   .1239536     0.15   0.878    -.2238791    .2620099
                                     16  |  -.0290687   .1253688    -0.23   0.817     -.274787    .2166496
                                     17  |  -.0772119   .1554961    -0.50   0.620    -.3819787    .2275549
                                     18  |  -.0038308    .157096    -0.02   0.981    -.3117332    .3040716
                                     19  |   .0343209   .1590961     0.22   0.829    -.2775017    .3461435
                                     20  |  -.0357025   .1607107    -0.22   0.824    -.3506898    .2792848
                                     21  |  -.0238769   .1875285    -0.13   0.899     -.391426    .3436722
                                     22  |   .0309564   .1886337     0.16   0.870    -.3387588    .4006717
                                     23  |   .0209997   .1892671     0.11   0.912     -.349957    .3919563
                                     24  |  -.0500927   .1884709    -0.27   0.790    -.4194889    .3193035
                                         |
                               stateFIPS |
                                      2  |  -10.57979   6.708618    -1.58   0.115    -23.72844    2.568858
                                      4  |   19.40122   9.132523     2.12   0.034     1.501805    37.30064
                                      5  |   3.018272   1.384839     2.18   0.029     .3040377    5.732506
                                      6  |   23.63834   12.06327     1.96   0.050    -.0052395    47.28192
                                      8  |  -.9657808   2.012715    -0.48   0.631     -4.91063    2.979068
                                      9  |   13.47484   6.765024     1.99   0.046     .2156346    26.73404
                                     10  |   19.51411   9.622529     2.03   0.043     .6543002    38.37392
                                     12  |   23.43384    13.2241     1.77   0.076    -2.484913     49.3526
                                     13  |   11.67206    5.93428     1.97   0.049     .0410878    23.30304
                                     15  |   24.35903   7.281714     3.35   0.001     10.08714    38.63093
                                     16  |  -5.736093   2.587691    -2.22   0.027    -10.80787   -.6643122
                                     17  |   17.25183   8.742633     1.97   0.048      .116586    34.38708
                                     18  |   16.39942   6.540867     2.51   0.012     3.579555    29.21928
                                     19  |  -6.288226   3.861123    -1.63   0.103    -13.85589    1.279436
                                     20  |  -1.508402   1.275371    -1.18   0.237    -4.008083    .9912795
                                     21  |    1.14316   1.359258     0.84   0.400    -1.520937    3.807256
                                     22  |   20.10313   10.70528     1.88   0.060    -.8788386    41.08509
                                     23  |  -33.80414   16.89586    -2.00   0.045    -66.91942   -.6888679
                                     24  |   10.31634   6.303524     1.64   0.102    -2.038344    22.67102
                                     25  |   13.64046   6.986196     1.95   0.051     -.052236    27.33315
                                     26  |   3.625952   2.086981     1.74   0.082     -.464456     7.71636
                                     27  |  -5.697974   4.443885    -1.28   0.200    -14.40783    3.011881
                                     28  |  -7.689155   4.092746    -1.88   0.060    -15.71079    .3324801
                                     29  |   4.754234   1.958942     2.43   0.015     .9147787     8.59369
                                     30  |  -23.41215   11.49107    -2.04   0.042    -45.93422   -.8900747
                                     31  |  -1.881205    1.62448    -1.16   0.247    -5.065126    1.302717
                                     32  |   31.99498    15.1599     2.11   0.035     2.282133    61.70783
                                     33  |  -16.99908     9.0976    -1.87   0.062    -34.83005    .8318833
                                     34  |   26.86672    12.3536     2.17   0.030     2.654108    51.07934
                                     35  |     10.948   5.516091     1.98   0.047     .1366583    21.75934
                                     36  |   16.19504   9.684755     1.67   0.094     -2.78673    35.17681
                                     37  |  -3.939617   1.753601    -2.25   0.025    -7.376612   -.5026221
                                     39  |   17.46323   7.749997     2.25   0.024     2.273515    32.65294
                                     40  |   2.331325   1.464408     1.59   0.111    -.5388622    5.201511
                                     41  |  -1.107935   .8304633    -1.33   0.182    -2.735613    .5197432
                                     42  |   17.73095   9.594129     1.85   0.065    -1.073201    36.53509
                                     44  |   24.16583   11.21109     2.16   0.031     2.192511    46.13916
                                     45  |    3.34504   2.147707     1.56   0.119    -.8643877    7.554468
                                     46  |   -8.81962   7.224059    -1.22   0.222    -22.97852    5.339276
                                     47  |   9.121081   4.029182     2.26   0.024     1.224029    17.01813
                                     48  |    18.5379      10.87     1.71   0.088    -2.766919    39.84272
                                     49  |   9.831259    4.43909     2.21   0.027     1.130802    18.53172
                                     51  |          0  (omitted)
                                     53  |          0  (omitted)
                                     54  |          0  (omitted)
                                     55  |          0  (omitted)
                                         |
                                   _cons |   18.14377   21.71737     0.84   0.403    -24.42148    60.70903
                         ln(popestimate) |          1  (exposure)
                  -----------------------+----------------------------------------------------------------
                                   /ln_r |   1.234311   .2796645                      .6861787    1.782443
                                   /ln_s |   1.132871   .3221651                      .5014393    1.764303
                  -----------------------+----------------------------------------------------------------
                                       r |    3.43601   .9609301                      1.986112    5.944363
                                       s |   3.104558    1.00018                      1.651096    5.837505
                  ----------------------------------------------------------------------------------------
                  LR test vs. pooled: chibar2(01) = 0.00                 Prob >= chibar2 = 1.000
                  Is that correct? Shouldn't they get dropped automatically?

                  Sincerely,
                  Sumedha.

                  Comment


                  • #10
                    Yes. The reason that didn't happen is that you used a random effects model, not a fixed-effects one. You need to specify the -fe- option or you get random effects by default.

                    Comment


                    • #11
                      Thank you Prof. Schechter... You are the best!

                      Comment


                      • #12
                        Prof. Schechter,

                        I would greatly appreciate more advise from you on some moderation effects in the above model. Per our discussion earlier I have run a non-linear gdid model and want to check if the gdid effect coefficient on variable *post* below is moderated by the *number_of_products* involved in the poisoning episode. To test this I have run the following, but am unsure how to interpret the moderation effect.
                        Code:
                        xtnbreg narc_nocod post treatMA  qavg_pct_lf_unemp pct_lhs pct_hs   perc_black perc_non
                        > white  pctmale pctover65  ///  // perfect
                        > state_share_rural_2010 md_100000 pa_100000 rn_100000 c.qtr /*c.qtrsq i.qtr i.stateFIPS
                        > i.stateFIPS#(c.qtr c.qtrsq)*/  if outcome==2, ///
                        >  fe   exposure(popestimate) /*vce(cluster stateFIPS)*/
                        
                        Iteration 0:   log likelihood = -4031.4822 
                        Iteration 1:   log likelihood =   -3946.46 
                        Iteration 2:   log likelihood =  -3921.122 
                        Iteration 3:   log likelihood = -3920.4956 
                        Iteration 4:   log likelihood = -3920.4951 
                        Iteration 5:   log likelihood = -3920.4951 
                        
                        Conditional FE negative binomial regression     Number of obs     =      1,128
                        Group variable: stateFIPS                       Number of groups  =         47
                        
                                                                        Obs per group:
                                                                                      min =         24
                                                                                      avg =       24.0
                                                                                      max =         24
                        
                                                                        Wald chi2(14)     =     271.48
                        Log likelihood  = -3920.4951                    Prob > chi2       =     0.0000
                        
                        ----------------------------------------------------------------------------------------
                                    narc_nocod |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                        -----------------------+----------------------------------------------------------------
                                          post |  -.0581924   .0299228    -1.94   0.052      -.11684    .0004552
                                       treatMA |  -.6859843   .2483113    -2.76   0.006    -1.172666    -.199303
                             qavg_pct_lf_unemp |   .0320403   .0116007     2.76   0.006     .0093033    .0547773
                                       pct_lhs |   .0159367   .0400112     0.40   0.690    -.0624838    .0943572
                                        pct_hs |  -.1195179   .0352984    -3.39   0.001    -.1887016   -.0503342
                                    perc_black |     .01854   .0133091     1.39   0.164    -.0075454    .0446255
                                 perc_nonwhite |   -.020706   .0090663    -2.28   0.022    -.0384756   -.0029365
                                       pctmale |   49.43308   14.53571     3.40   0.001     20.94361    77.92254
                                     pctover65 |   9.537804   3.295098     2.89   0.004     3.079531    15.99608
                        state_share_rural_2010 |  -.1819074   1.331938    -0.14   0.891    -2.792458    2.428643
                                     md_100000 |  -.0033577   .0027762    -1.21   0.226    -.0087989    .0020834
                                     pa_100000 |   .0086991   .0094377     0.92   0.357    -.0097984    .0271967
                                     rn_100000 |   .0043414   .0009338     4.65   0.000     .0025112    .0061716
                                           qtr |  -.0068332   .0042989    -1.59   0.112    -.0152588    .0015925
                                         _cons |  -37.43445   7.363817    -5.08   0.000    -51.86726   -23.00163
                               ln(popestimate) |          1  (exposure)
                        ----------------------------------------------------------------------------------------
                        
                        .
                        .  /*works*/
                        . xtnbreg narc_nocod post##c.number_of_products treatMA  qavg_pct_lf_unemp pct_lhs pct_hs
                        >    perc_black perc_nonwhite  pctmale pctover65  ///  // perfect
                        > state_share_rural_2010 md_100000 pa_100000 rn_100000 c.qtr /*c.qtrsq i.qtr i.stateFIPS
                        > i.stateFIPS#(c.qtr c.qtrsq)*/  if outcome==2, ///
                        >     exposure(popestimate) /*vce(cluster stateFIPS)*/
                        
                        Fitting negative binomial (constant dispersion) model:
                        
                        Iteration 0:   log likelihood = -8588.8326 
                        Iteration 1:   log likelihood = -8166.8883 
                        Iteration 2:   log likelihood = -8165.9098 
                        Iteration 3:   log likelihood = -8165.9098 
                        
                        Iteration 0:   log likelihood = -6851.2913 
                        Iteration 1:   log likelihood =  -6256.026 
                        Iteration 2:   log likelihood = -6165.3081 
                        Iteration 3:   log likelihood = -5188.9244 
                        Iteration 4:   log likelihood = -5136.6589 
                        Iteration 5:   log likelihood = -5135.4738 
                        Iteration 6:   log likelihood = -5135.4735 
                        
                        Iteration 0:   log likelihood = -5135.4735 
                        Iteration 1:   log likelihood = -4977.1054 
                        Iteration 2:   log likelihood = -4963.0043 
                        Iteration 3:   log likelihood = -4962.9745 
                        Iteration 4:   log likelihood = -4962.9745 
                        
                        Fitting full model:
                        
                        Iteration 0:   log likelihood = -4412.6049 
                        Iteration 1:   log likelihood = -4310.5657 
                        Iteration 2:   log likelihood = -4295.3871 
                        Iteration 3:   log likelihood = -4293.9685 
                        Iteration 4:   log likelihood =  -4293.961 
                        Iteration 5:   log likelihood =  -4293.961 
                        
                        Random-effects negative binomial regression     Number of obs     =      1,128
                        Group variable: stateFIPS                       Number of groups  =         47
                        
                        Random effects u_i ~ Beta                       Obs per group:
                                                                                      min =         24
                                                                                      avg =       24.0
                                                                                      max =         24
                        
                                                                        Wald chi2(16)     =     240.76
                        Log likelihood  =  -4293.961                    Prob > chi2       =     0.0000
                        
                        ----------------------------------------------------------------------------------------
                                    narc_nocod |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                        -----------------------+----------------------------------------------------------------
                                        1.post |  -.4075164   .1299643    -3.14   0.002    -.6622417   -.1527912
                            number_of_products |   .0110505    .020166     0.55   0.584    -.0284742    .0505752
                                               |
                                          post#|
                          c.number_of_products |
                                            1  |   .1213947   .0432257     2.81   0.005     .0366739    .2061154
                                               |
                                       treatMA |  -.3095495   .1599911    -1.93   0.053    -.6231264    .0040273
                             qavg_pct_lf_unemp |   .0233724   .0113246     2.06   0.039     .0011766    .0455683
                                       pct_lhs |   .0397096   .0312231     1.27   0.203    -.0214865    .1009056
                                        pct_hs |  -.0924605   .0254464    -3.63   0.000    -.1423345   -.0425864
                                    perc_black |   .0119409    .011146     1.07   0.284    -.0099049    .0337868
                                 perc_nonwhite |  -.0154878   .0068944    -2.25   0.025    -.0290005   -.0019751
                                       pctmale |   38.60328   12.99778     2.97   0.003      13.1281    64.07846
                                     pctover65 |   7.526031   3.080539     2.44   0.015     1.488285    13.56378
                        state_share_rural_2010 |   1.123388   .7737569     1.45   0.147    -.3931473    2.639924
                                     md_100000 |    .001194   .0015647     0.76   0.445    -.0018728    .0042608
                                     pa_100000 |   .0028389   .0062256     0.46   0.648    -.0093631    .0150409
                                     rn_100000 |   .0020772   .0005781     3.59   0.000     .0009442    .0032102
                                           qtr |  -.0088229   .0041214    -2.14   0.032    -.0169006   -.0007451
                                         _cons |  -32.34913   6.672867    -4.85   0.000    -45.42771   -19.27055
                               ln(popestimate) |          1  (exposure)
                        -----------------------+----------------------------------------------------------------
                                         /ln_r |   1.555888   .2456275                      1.074467    2.037309
                                         /ln_s |    1.80133   .2662317                      1.279526    2.323135
                        -----------------------+----------------------------------------------------------------
                                             r |   4.739295   1.164101                      2.928433    7.669943
                                             s |   6.057699   1.612751                      3.594934    10.20762
                        ----------------------------------------------------------------------------------------
                        LR test vs. pooled: chibar2(01) = 1338.03              Prob >= chibar2 = 0.000
                        I would greatly appreciate any guidance you may be able to offer.
                        Sincerely,
                        Sumedha.

                        Comment


                        • #13
                          Rather than writing paragraphs trying to explain it in words, it is much easier to visualize it graphically. Run the following after your model including the interaction.
                          Code:
                          margins post, at(number_of_products = (interesting list of values)) predict(iru0)
                          marginsplot, xdimension(number_of_products)
                          Replace "interesting list of values" in the above by a list of numerical values of number_of_products that spans the range of values of that variable that are realistic and important, the range of values about which you would like to understand the process. The longer the list of of values you provide, the smoother the curves will be, but the longer it will take Stata to do the calculations.

                          The graph will consistent of two curves, one corresponding to post = 1 and the other to post = 0. Each curve shows the corresponding relationship between number of products and population-based rate of narc_nocod (conditional on the random effects being 0, i.e. something like for an average state).

                          Comment


                          • #14
                            Thank you Prof. Schechter. I tried a bit and somehow the image upload didn't work. Sorry for sending an attachment. I know Statalist discourages that.

                            So, can I say the number_of_products has no moderation effect in the post perioid?

                            Sincerely,
                            Sumedha.
                            Attached Files

                            Comment


                            • #15
                              It appears that in the post = 0 condition, the predicted incidence rate is almost exactly constant, regardless of the number of products. So one could say that as "in the post = 0 condition, predicted incidence rate is nearly independent of the number of predicts, whereas in the post = 1 condition the predicted incidence rate is a clearly increasing function of the number of products."

                              As for your suggested language, "the number_of_products has no moderation effect in the post perioid, [I think you meant pre, not post, right?]" that would be a misinterpretation of the graph, and, actually, just a plain misuse of language. A moderation effect refers to how a variable effects the outcome changes when some other variable changes. So it is not even meaningful to speak of a moderation effect "in the post [nor pre] period." The moderation effect is about the difference between the relationship between the outcome rate and number of products in the pre and post conditions. As you can see, the two curves are very different, it is clear that the intervention moderates the effect of the number of products. You can also view it the other way. Look at the vertical difference between the two curves at each number of products. That vertical difference is the effect of the intervention (post) at each number of products. So you can see that the intervention effect clearly varies according to the number of products, which is the clearer way of saying that number of products moderates the intervention effect.

                              These things are difficult to put into words clearly, and it is very easy to say things that are "sort of right" but don't hold up on closer attention. Focus on the graph: that is the key finding here, and it is the graph as a whole, rather than any particular point or curve on it that matters. That is the message. If you include a graph like that in your presentation/paper, people will immediately grasp what is happening. You can supplement that with verbiage, but it will never be as clear in words as it is in the graph.

                              Comment

                              Working...
                              X