Hi all,
I have stock data, so stock permno and date identifies an observation.
There are multiple events, and for each event, there is a dummy variable for pre-event and post-event windows (i.e., pre_e1, post_e1, pre_e2, post_e2,..., pre_e5, post_e5).
I am interested in estimating betas for each stock and for each window. For example, pseudo,
for permno = 1 to 5 {
reg stock_excess_return market_excess_return if permno==i&pre_e1
reg stock_excess_return market_excess_return if permno==i&post_e1
reg stock_excess_return market_excess_return if permno==i&pre_e2
reg stock_excess_return market_excess_return if permno==i&post_e2
...
reg stock_excess_return market_excess_return if permno==i&pre_e5
reg stock_excess_return market_excess_return if permno==i&post_e5
}
and I am interested in storing regression coefficients for all the regressions.
I did find,
statsby, by(permno): reg stock_excess_return market_excess_return if pre_e1
But statsby runs regressions under only one if condition. Is there a way I can run multiple regressions by permno and save regression coefficients for all of these at the same time? It feels like it ought to be much faster that way.
I'd much appreciate any and all helps.
Thanks so much!
Best,
John
I have stock data, so stock permno and date identifies an observation.
There are multiple events, and for each event, there is a dummy variable for pre-event and post-event windows (i.e., pre_e1, post_e1, pre_e2, post_e2,..., pre_e5, post_e5).
I am interested in estimating betas for each stock and for each window. For example, pseudo,
for permno = 1 to 5 {
reg stock_excess_return market_excess_return if permno==i&pre_e1
reg stock_excess_return market_excess_return if permno==i&post_e1
reg stock_excess_return market_excess_return if permno==i&pre_e2
reg stock_excess_return market_excess_return if permno==i&post_e2
...
reg stock_excess_return market_excess_return if permno==i&pre_e5
reg stock_excess_return market_excess_return if permno==i&post_e5
}
and I am interested in storing regression coefficients for all the regressions.
I did find,
statsby, by(permno): reg stock_excess_return market_excess_return if pre_e1
But statsby runs regressions under only one if condition. Is there a way I can run multiple regressions by permno and save regression coefficients for all of these at the same time? It feels like it ought to be much faster that way.
I'd much appreciate any and all helps.
Thanks so much!
Best,
John
Comment