Let's examine the problem. Run the psmatch2 command with eststo, and then run "return list" to see the scalars stored as a result of psmatch2:
Code:
eststo: psmatch2 dependent_var independent_var1 independent_var2, out(outcome_var) return list
However, eststo does not store r(att) and r(seatt) automatically as an active estimation result. Therefore, running esttab after simply gives you the results from the unmatched sample.
The solution here is to use estadd to store r(att) and r(seatt), and then run esttab. Estadd will store r(att) and r(seatt) as estimation results, which esttab can then access.
Here is my solution, in which I also calculate the t statistic and two-tailed p-value. Obviously, substitute the dependent, independent, and outcome variables for your own variables.
Code:
eststo clear eststo: psmatch2 dependent_var independent_var1 independent_var2, out(outcome_var) estadd scalar r(att) estadd scalar r(seatt) estadd scalar t_stat = (r(att)/r(seatt)) estadd scalar p_value = (2 * ttail(e(df_r), abs(e(t_stat)))) esttab, scalars(att seatt t_stat p_value) drop(_treated _cons) obslast
This is still an incomplete solution as I cannot find a way to automatically star the p-values, but I believe it is helpful nonetheless.
0 Response to Exporting psmatch2 results on the matched sample: a solution with esttab
Post a Comment