I am estimating a logistic fixed effects regression to estimate the effect of a policy change on a binary outcome variable. In my results table that I create using the esttab command I want to include the binary distribution of the outcome variable in the pre-treatment period. Something as follows:
Code:
prop opioidpois if post==0 & treat==1 Proportion estimation Number of obs = 802 -------------------------------------------------------------- | Proportion Std. Err. [95% Conf. Interval] -------------+------------------------------------------------ opioidpois | 0 | .8029925 .0140534 .7739456 .8291311 1 | .1970075 .0140534 .1708689 .2260544 -------------------------------------------------------------- . local base=e(cmd) . eststo raw1: xtlogit opioidpois i.post did age, fe note: multiple positive outcomes within groups encountered. note: 609 groups (1,218 obs) dropped because of all positive or all negative outcomes. Iteration 0: log likelihood = -481.84658 Iteration 1: log likelihood = -384.481 Iteration 2: log likelihood = -383.05408 Iteration 3: log likelihood = -383.05124 Iteration 4: log likelihood = -383.05124 Conditional fixed-effects logistic regression Number of obs = 1,706 Group variable: studypersonid Number of groups = 853 Obs per group: min = 2 avg = 2.0 max = 2 LR chi2(3) = 416.41 Log likelihood = -383.05124 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ opioidpois | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.post | .6571757 .2257941 2.91 0.004 .2146274 1.099724 did | 1.332142 .1859222 7.17 0.000 .967741 1.696543 age | .0764154 .0991872 0.77 0.441 -.1179879 .2708186 ------------------------------------------------------------------------------ . eststo margin1: margins, dydx(did) post Average marginal effects Number of obs = 1,706 Model VCE : OIM Expression : Pr(opioidpois|fixed effect is 0), predict(pu0) dy/dx w.r.t. : did ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- did | .0565268 .1390073 0.41 0.684 -.2159225 .3289761 ------------------------------------------------------------------------------ . estadd mat Bsl = `base' proportion not found r(111);
esttab using "F.csv", keep(post) margin b(a4) se(4) nogaps nolabel star(* 0.10 ** 0.05 *** 0.01) ///
label title(Impact of intervention on prescription opioid poisonings, 2011-2019.) ///
mtitles( "ALL Presc. Opioids") stats(N Bsl) coeflabels(post "Impact Intervention" ) replace
The idea is to express the treatment effect in comparison to the proportion at baseline.
I will be grateful for your help.
Sincerely,
Sumedha.
0 Response to Adding 'proportion' to esttab command.
Post a Comment