Hi, I'm estimating a DID model using count data. In my regressions I use a poisson model with weights to take into account an attrition problem in the non-response to the experiment.
When I estimate the equation for each group of individuals, C = 1, ... 4 separately I obtain different coefficients in the average marginal effects, in comparison to when a single equation is estimated considering different terms of interaction.
I do not understand what the difference may be due to.
Here each of the equations individually and their AME
Now, when estimating the four equations in one, I get the same coefficients but different AME's
I appreciate the suggestions you can provide. Rene
When I estimate the equation for each group of individuals, C = 1, ... 4 separately I obtain different coefficients in the average marginal effects, in comparison to when a single equation is estimated considering different terms of interaction.
I do not understand what the difference may be due to.
Here each of the equations individually and their AME
Code:
. First equation . poisson ntbim i.time i.treated i.did [pw= weights ] if c==1, vce(cluster id) Iteration 0: log pseudolikelihood = -27353.006 Iteration 1: log pseudolikelihood = -27353.006 Poisson regression Number of obs = 24618 Wald chi2(3) = 361.64 Log pseudolikelihood = -27353.006 Prob > chi2 = 0.0000 (Std. Err. adjusted for 4103 clusters in id) ------------------------------------------------------------------------------ | Robust ntbim | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.time | .2601418 .0141357 18.40 0.000 .2324363 .2878474 1.treated | .0152871 .0078754 1.94 0.052 -.0001484 .0307226 1.did | -.3630388 .026564 -13.67 0.000 -.4151033 -.3109742 _cons | 1.127303 .0060501 186.33 0.000 1.115445 1.139161 ------------------------------------------------------------------------------ . margins, dydx(*) Average marginal effects Number of obs = 24618 Model VCE : Robust Expression : Predicted number of events, predict() dy/dx w.r.t. : 1.time 1.treated 1.did ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.time | .8032912 .0455933 17.62 0.000 .7139299 .8926525 1.treated | .051304 .0264289 1.94 0.052 -.0004957 .1031036 1.did | -1.181889 .080278 -14.72 0.000 -1.339231 -1.024547 ------------------------------------------------------------------------------ Note: dy/dx for factor levels is the discrete change from the base level. . Second equation . poisson ntbim i.time i.treated i.did [pw= weights ] if c==2, vce(cluster id) Iteration 0: log pseudolikelihood = -6626.5352 Iteration 1: log pseudolikelihood = -6626.535 Poisson regression Number of obs = 3978 Wald chi2(3) = 380.44 Log pseudolikelihood = -6626.535 Prob > chi2 = 0.0000 (Std. Err. adjusted for 663 clusters in id) ------------------------------------------------------------------------------ | Robust ntbim | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.time | .4055877 .0272316 14.89 0.000 .3522147 .4589607 1.treated | -.0304311 .0385052 -0.79 0.429 -.1058998 .0450377 1.did | -.0767001 .0384431 -2.00 0.046 -.1520471 -.001353 _cons | .8639051 .0294198 29.36 0.000 .8062434 .9215668 ------------------------------------------------------------------------------ . margins, dydx(*) Average marginal effects Number of obs = 3978 Model VCE : Robust Expression : Predicted number of events, predict() dy/dx w.r.t. : 1.time 1.treated 1.did ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.time | 1.126398 .0747509 15.07 0.000 .9798891 1.272907 1.treated | -.09703 .1230382 -0.79 0.430 -.3381804 .1441204 1.did | -.243959 .1217255 -2.00 0.045 -.4825366 -.0053814 ------------------------------------------------------------------------------ Note: dy/dx for factor levels is the discrete change from the base level. . Third equation . poisson ntbim i.time i.treated i.did [pw= weights ] if c==3, vce(cluster id) Iteration 0: log pseudolikelihood = -15220.496 Iteration 1: log pseudolikelihood = -15220.496 Poisson regression Number of obs = 10428 Wald chi2(3) = 118.69 Log pseudolikelihood = -15220.496 Prob > chi2 = 0.0000 (Std. Err. adjusted for 1738 clusters in id) ------------------------------------------------------------------------------ | Robust ntbim | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.time | .1472828 .014761 9.98 0.000 .1183519 .1762138 1.treated | .0084261 .0169112 0.50 0.618 -.0247193 .0415716 1.did | -.2329616 .0296375 -7.86 0.000 -.29105 -.1748731 _cons | 1.930198 .0115102 167.69 0.000 1.907638 1.952758 ------------------------------------------------------------------------------ . margins, dydx(*) Average marginal effects Number of obs = 10428 Model VCE : Robust Expression : Predicted number of events, predict() dy/dx w.r.t. : 1.time 1.treated 1.did ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.time | 1.004082 .1011709 9.92 0.000 .8057905 1.202373 1.treated | .0602647 .1209876 0.50 0.618 -.1768666 .2973959 1.did | -1.628146 .1956028 -8.32 0.000 -2.011521 -1.244772 ------------------------------------------------------------------------------ Note: dy/dx for factor levels is the discrete change from the base level. . Fourth equation . poisson ntbim i.time i.treated i.did [pw= weights ] if c==4, vce(cluster id) Iteration 0: log pseudolikelihood = -36922.544 Iteration 1: log pseudolikelihood = -36922.544 Poisson regression Number of obs = 29148 Wald chi2(3) = 136.72 Log pseudolikelihood = -36922.544 Prob > chi2 = 0.0000 (Std. Err. adjusted for 4858 clusters in id) ------------------------------------------------------------------------------ | Robust ntbim | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.time | .0067251 .0126926 0.53 0.596 -.0181519 .0316021 1.treated | .0553515 .0273121 2.03 0.043 .0018207 .1088822 1.did | -.2756361 .0263997 -10.44 0.000 -.3273786 -.2238937 _cons | 2.741108 .0209913 130.58 0.000 2.699966 2.78225 ------------------------------------------------------------------------------ . margins, dydx(*) Average marginal effects Number of obs = 29148 Model VCE : Robust Expression : Predicted number of events, predict() dy/dx w.r.t. : 1.time 1.treated 1.did ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.time | .0954102 .1799996 0.53 0.596 -.2573825 .448203 1.treated | .7862371 .3864334 2.03 0.042 .0288415 1.543633 1.did | -3.877305 .3476167 -11.15 0.000 -4.558622 -3.195989 ------------------------------------------------------------------------------ Note: dy/dx for factor levels is the discrete change from the base level.
Code:
. poisson ntbim i.timeXc1 i.timeXc2 i.timeXc3 i.timeXc4 i.treatedXc1 i.treatedXc2 i.treatedXc3 i.treatedXc4 i.didXc1 i. > didXc2 i.didXc3 i.didXc4 i.c [pw= weights ], vce(cluster id) Iteration 0: log pseudolikelihood = -86164.645 Iteration 1: log pseudolikelihood = -86122.592 Iteration 2: log pseudolikelihood = -86122.581 Iteration 3: log pseudolikelihood = -86122.581 Poisson regression Number of obs = 68172 Wald chi2(15) = 21288.44 Log pseudolikelihood = -86122.581 Prob > chi2 = 0.0000 (Std. Err. adjusted for 11362 clusters in id) ------------------------------------------------------------------------------ | Robust ntbim | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.timeXc1 | .2601418 .0141346 18.40 0.000 .2324384 .2878452 1.timeXc2 | .4055878 .0272123 14.90 0.000 .3522527 .4589229 1.timeXc3 | .1472828 .0147574 9.98 0.000 .1183589 .1762068 1.timeXc4 | .0067251 .0126918 0.53 0.596 -.0181504 .0316007 1.treatedXc1 | .0152871 .0078748 1.94 0.052 -.0001472 .0307214 1.treatedXc2 | -.0304312 .0384778 -0.79 0.429 -.1058464 .0449839 1.treatedXc3 | .0084261 .0169071 0.50 0.618 -.0247112 .0415635 1.treatedXc4 | .0553515 .0273105 2.03 0.043 .0018239 .108879 1.didXc1 | -.3630388 .026562 -13.67 0.000 -.4150992 -.3109783 1.didXc2 | -.0766999 .0384158 -2.00 0.046 -.1519934 -.0014064 1.didXc3 | -.2329616 .0296303 -7.86 0.000 -.2910358 -.1748873 1.didXc4 | -.2756361 .0263982 -10.44 0.000 -.3273756 -.2238967 | c | 2 | -.2633981 .0300149 -8.78 0.000 -.3222262 -.20457 3 | .802895 .0130007 61.76 0.000 .777414 .828376 4 | 1.613805 .0218444 73.88 0.000 1.570991 1.656619 | _cons | 1.127303 .0060497 186.34 0.000 1.115446 1.13916 ------------------------------------------------------------------------------ . margins, dydx(*) Average marginal effects Number of obs = 68172 Model VCE : Robust Expression : Predicted number of events, predict() dy/dx w.r.t. : 1.timeXc1 1.timeXc2 1.timeXc3 1.timeXc4 1.treatedXc1 1.treatedXc2 1.treatedXc3 1.treatedXc4 1.didXc1 1.didXc2 1.didXc3 1.didXc4 2.c 3.c 4.c ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.timeXc1 | 1.936844 .1189861 16.28 0.000 1.703636 2.170053 1.timeXc2 | 3.346499 .272525 12.28 0.000 2.81236 3.880638 1.timeXc3 | 1.053454 .1124373 9.37 0.000 .8330814 1.273827 1.timeXc4 | .0457593 .0864786 0.53 0.597 -.1237356 .2152543 1.treatedXc1 | .1046128 .0542193 1.93 0.054 -.0016552 .2108807 1.treatedXc2 | -.2040269 .2543261 -0.80 0.422 -.702497 .2944432 1.treatedXc3 | .0575016 .1157715 0.50 0.619 -.1694064 .2844096 1.treatedXc4 | .3813192 .1902857 2.00 0.045 .0083661 .7542722 1.didXc1 | -2.140394 .1345794 -15.90 0.000 -2.404165 -1.876623 1.didXc2 | -.5031645 .2429878 -2.07 0.038 -.9794119 -.0269171 1.didXc3 | -1.441417 .1654486 -8.71 0.000 -1.76569 -1.117143 1.didXc4 | -1.751581 .151549 -11.56 0.000 -2.048612 -1.454551 | c | 2 | -.7609504 .078985 -9.63 0.000 -.9157582 -.6061426 3 | 4.048494 .0886253 45.68 0.000 3.874791 4.222196 4 | 13.21644 .3300686 40.04 0.000 12.56952 13.86337 ------------------------------------------------------------------------------ Note: dy/dx for factor levels is the discrete change from the base level.
Comment