LOST-STATS / lost-stats.github.io

Source code for the Library of Statistical Techniques
https://lost-stats.github.io/
GNU General Public License v2.0
257 stars 166 forks source link

Event study in Stata #209

Open Swarup8289 opened 5 months ago

Swarup8289 commented 5 months ago

First, thanks a lot for putting this out for learners like us. I was wondering if i can use the following for repeated cross sectional data as well?

*Code copy and pasted from the diff-in-diff event study section*****

use "https://raw.githubusercontent.com/LOST-STATS/LOST-STATS.github.io/master/Model_Estimation/Data/Event_Study_DiD/bacon_example.dta", clear

sort time_to_treat

twoway (sc coef time_to_treat, connect(line)) /// (rcap ci_top ci_bottom time_to_treat) /// (function y = 0, range(time_to_treat)) /// (function y = 0, range(bottom_range'top_range') horiz), /// xtitle("Time to Treatment") caption("95% Confidence Intervals Shown")

NickCH-K commented 5 months ago

Yep, should work fine for DID performed with repeated cross section data.