Hi there,
I am running the xtreg command on Stata 17 MP on a Mac M2 to look at the impact of protests on economic values (eg stocks). My panel data is at the city level. To set up the panel, I run
Then running the regression
yields the error 'not sorted' due to this use of the lagged event_dummy variable. However, if I instead initialize the lagged variable beforehand and then run the regression, like so:
everything works fine. Any advice on what Im doing wrong would be appreciated.
Best,
Sam
I am running the xtreg command on Stata 17 MP on a Mac M2 to look at the impact of protests on economic values (eg stocks). My panel data is at the city level. To set up the panel, I run
Code:
sort city_num date_num xtset city_num date_num, daily
Code:
xtreg spread_us L1.event_dummy $all_controls i.year_month
Code:
gen event_dummy_1d_lag = L1.event_dummy xtreg spread_us event_dummy_1d_lag $all_controls i.year_month
Best,
Sam
Comment