Hey, I'm trying to estimate a simple DID regression on my panel data (400 observations from 2000-2022). I have created a Dummy variable for Treatment and a Dummy variable for Time (Post=1 and Pre=0) and an interaction term between Treatment and Post. My treatment started in 2016. I used this command to estimate my DID :
xtdidregress (all) (treatpost), group(K_id) time(period)
where "period" is the time variable, "K_id" is the Id for each observation in my sample and "all" is the dependent variable.
My question is the following:
When I enter this command, Stata uses only one period for pre-treatment (2000) and also only one period for after-treatment (2016). What I need is that it uses all of my pre and post-treatment periods for the estimation.
How can I change that? What do I miss?
Thanks very much in advance.
xtdidregress (all) (treatpost), group(K_id) time(period)
where "period" is the time variable, "K_id" is the Id for each observation in my sample and "all" is the dependent variable.
My question is the following:
When I enter this command, Stata uses only one period for pre-treatment (2000) and also only one period for after-treatment (2016). What I need is that it uses all of my pre and post-treatment periods for the estimation.
How can I change that? What do I miss?
Thanks very much in advance.
Comment