Dear Statalisters,
I am having trouble in storing regression constants of my OLS Regressions. I want to compute daily regressions for each company in my sample; obs_id identifies company and date.
I tried to build the following loop, somehow the saved coefficient is the same for the whole sample.
I would appreciate any comments or ideas on my code. I also tried statsby, but my sample is too large to use that command.
Thanks in advance!
Kind regards,
Nils
I am having trouble in storing regression constants of my OLS Regressions. I want to compute daily regressions for each company in my sample; obs_id identifies company and date.
I tried to build the following loop, somehow the saved coefficient is the same for the whole sample.
Code:
foreach x in obs_id {
newey retRF MktRF SMB HML if obs_id == `x', lag(0)
mat A = e(b)
quietly replace constant = A[1, 4] if obs_id == `x'
matrix A = .
}
Thanks in advance!
Kind regards,
Nils

Comment