Hi all,
I am running a Poisson Two Way Fixed Effects model to estimate the effect of a policy/treatment.
Poisson regression would produce the proportional change with respect to a counterfactual scenario without treatment, i.e. \[ (e^{\beta}-1) = \frac{\mathbb{E}[Y_{it}(1)\mid \text{Treat,Post}]-\mathbb{E}[Y_{it}(0)\mid \text{Treat,Post}]}{\mathbb{E}[Y_{it}(0)\mid \text{Treat,Post}]} \]
where Y(1) and Y(0) are the potential outcomes with and without treatment.
I am interested in the effect in levels, that is \[ \mathbb{E}[Y_{it}(1)\mid \text{Treat,Post}]-\mathbb{E}[Y_{it}(0)\mid \text{Treat,Post}] \]
which theoretically it's just a matter of dividing (exp(beta)-1) by the predicted counterfactual \[ \mathbb{E}[Y_{it}(0)\mid \text{Treat,Post}] \]
I was planning to use the margins command to do so. However, I have two questions:
1. Is it doable/correct (as far as I understand the main issue is that the fixed effects might be imprecisely estimated)
2.Is the right way of doing it to use the poisson regression command and not the xtpoisson? The margin command would give different estimates of the effect in levels after poisson vs xtpoisson. (because xtpoisson gets rid of the FE)
Example code: I use hospdd, which is a Stata dataset utilised in the didregress command. I collapse the data to end up with a hospital by month panel, and finally I use the floor() function to get the outcome variable satis to be an integer. procedure is the binary treatment variables which is 1 for a selected group of hospitals and months. I am using Stata 18.
The estimated coefficients of these two regression models are identical as expected
However, the margin command would give different estimates
In particular, margins after xtpoisson simply returns the estimated coefficients, which is mentioned in the help. I know similar questions have been posted here https://www.statalist.org/forums/for...fter-xtpoisson and @JoaoSantosSilva has commented on it in the past, but wanted to double check my reasoning is correct.
Cheers,
Mario
I am running a Poisson Two Way Fixed Effects model to estimate the effect of a policy/treatment.
Poisson regression would produce the proportional change with respect to a counterfactual scenario without treatment, i.e. \[ (e^{\beta}-1) = \frac{\mathbb{E}[Y_{it}(1)\mid \text{Treat,Post}]-\mathbb{E}[Y_{it}(0)\mid \text{Treat,Post}]}{\mathbb{E}[Y_{it}(0)\mid \text{Treat,Post}]} \]
where Y(1) and Y(0) are the potential outcomes with and without treatment.
I am interested in the effect in levels, that is \[ \mathbb{E}[Y_{it}(1)\mid \text{Treat,Post}]-\mathbb{E}[Y_{it}(0)\mid \text{Treat,Post}] \]
which theoretically it's just a matter of dividing (exp(beta)-1) by the predicted counterfactual \[ \mathbb{E}[Y_{it}(0)\mid \text{Treat,Post}] \]
I was planning to use the margins command to do so. However, I have two questions:
1. Is it doable/correct (as far as I understand the main issue is that the fixed effects might be imprecisely estimated)
2.Is the right way of doing it to use the poisson regression command and not the xtpoisson? The margin command would give different estimates of the effect in levels after poisson vs xtpoisson. (because xtpoisson gets rid of the FE)
Example code: I use hospdd, which is a Stata dataset utilised in the didregress command. I collapse the data to end up with a hospital by month panel, and finally I use the floor() function to get the outcome variable satis to be an integer. procedure is the binary treatment variables which is 1 for a selected group of hospitals and months. I am using Stata 18.
Code:
webuse hospdd, clear collapse (mean) satis procedure, by(hospital month) ge satis_int = floor(satis) tab satis_int collect create ex1, replace collect _r_b _r_se, tag(model[(1)]): qui poisson satis_int procedure i.hospital i.month xtset hospital month collect _r_b _r_se, tag(model[(2)]): qui xtpoisson satis_int procedure i.month, fe i(hospital) collect layout (colname[procedure]) (model#result[_r_b _r_se])
Code:
Collection: ex1 Rows: colname[procedure] Columns: model#result[_r_b _r_se] Table 1: 1 x 4 ---------------------------------------------------------------- | (1) (1) (2) (2) | Coefficient Std. error Coefficient Std. error -----------------+---------------------------------------------- (mean) procedure | .2641435 .1298382 .2641435 .1298382 ----------------------------------------------------------------
Code:
qui poisson satis_int procedure i.hospital i.month . margins, at((asobs) _all) at(procedure==0)subpop(if procedure==1) pwcompare Pairwise comparisons of predictive margins Number of obs = 322 Model VCE: OIM Subpop. no. obs = 72 Expression: Predicted number of events, predict() 1._at: (asobserved) 2._at: procedure = 0 -------------------------------------------------------------- | Delta-method Unadjusted | Contrast std. err. [95% conf. interval] -------------+------------------------------------------------ _at | 2 vs 1 | -.8995296 .4139294 -1.710816 -.088243 -------------------------------------------------------------- . . qui xtpoisson satis_int procedure i.month, fe i(hospital) . margins, at((asobs) _all) at(procedure==0)subpop(if procedure==1) pwcompare Pairwise comparisons of predictive margins Number of obs = 322 Model VCE: OIM Subpop. no. obs = 72 Expression: Linear prediction, predict() 1._at: (asobserved) 2._at: procedure = 0 -------------------------------------------------------------- | Delta-method Unadjusted | Contrast std. err. [95% conf. interval] -------------+------------------------------------------------ _at | 2 vs 1 | -.2641435 .1298382 -.5186218 -.0096652 --------------------------------------------------------------
Cheers,
Mario
Comment