Hi there, I am new to STATA and trying to run a rolling regression on panel data;
I have stock prices for 54 companies monthly for 10 years (fig.1) and convert them to panel data (fig.2). The first 10 companies are treatment group and the rest are control group (Difference in Difference model)
1. to generate panel regression:
encode code, gen(con_cod)
xtset con_cod time
xtreg ln_ri dummy, fe
2. to generate rolling regression
asreg ln_ri dummy, wind(time 36)
The problem with the second part is that it gives me coefficients for each company at each point in time. However, I need to regress the treatment group over the control group and get the overall coefficient at each month (Parallel Trend Assumption, Fig3. y-axis: coefficients and x-axis: time)
Any help would be appreciated.
I have stock prices for 54 companies monthly for 10 years (fig.1) and convert them to panel data (fig.2). The first 10 companies are treatment group and the rest are control group (Difference in Difference model)
1. to generate panel regression:
encode code, gen(con_cod)
xtset con_cod time
xtreg ln_ri dummy, fe
2. to generate rolling regression
asreg ln_ri dummy, wind(time 36)
The problem with the second part is that it gives me coefficients for each company at each point in time. However, I need to regress the treatment group over the control group and get the overall coefficient at each month (Parallel Trend Assumption, Fig3. y-axis: coefficients and x-axis: time)
Any help would be appreciated.
Comment