Hello,
Can you please help me on how I could add the sample size of the dependent variable to a collection of post-estimation results and stack multiple collections? I am interested in collecting the ATT, its confidence interval and the sample size for multiple dependent variables. For each dependent variable, I run a DiD regression using the csdid command based on the Callaway and Sant'Anna (2021) approach. The following command gives me a table for the ATT and its confidence interval for the first dependent variable.
I want to add the sample size of the dependent variable (example, by running "sum lemp") to the collection so that I can have a table that looks like the following.
I also have another dependent variable, say lother and want to stack the results below the above table
I want to stack the two collections and create a table that looks like the following
I appreciate your help.
Thanks,
Dani
Can you please help me on how I could add the sample size of the dependent variable to a collection of post-estimation results and stack multiple collections? I am interested in collecting the ATT, its confidence interval and the sample size for multiple dependent variables. For each dependent variable, I run a DiD regression using the csdid command based on the Callaway and Sant'Anna (2021) approach. The following command gives me a table for the ATT and its confidence interval for the first dependent variable.
Code:
use https://friosavila.github.io/playingwithstata/drdid/mpdta.dta, clear csdid lemp lpop , ivar(countyreal) time(year) gvar(first_treat) method(dripw) collect _r_b _r_ci: estat simple
ATT | -0.042 |
CI | (-0.064,-0.019) |
N | [2500] |
I also have another dependent variable, say lother and want to stack the results below the above table
Code:
set seed 123456 gen lother = lemp*runiform() csdid lother lpop , ivar(countyreal) time(year) gvar(first_treat) method(dripw) collect _r_b _r_ci: estat simple
ATT(lemp) | -0.042 |
CI(lemp) | (-0.064,-0.019) |
N(lemp) | [2500] |
ATT(lother) | 0.043 |
CI(lother) | (-0.407,0.492) |
N(lother) | [2500] |
I appreciate your help.
Thanks,
Dani
Comment