There are monthly mutual fund returns directly obtained from CRSP mutual fund dataset, called the raw net return.
But in the literature, researchers usually used the risk-adjusted returns in their analysis.
We need to do the rolling regression with 36months as the moving window;
at the beginning of each calendar year, for each fund, estimate the following carhart model, using fund returns for the previous 36 months:
R-Rf = a + b1*mktrf +b2*smb +b3* hml + b4*umd+error term
In stata, my code is:
qui levelsof wficn, local(ids)
foreach id of local ids {
quietly: rolling, window(36) saving(`stats', replace) nodots: reg mret_rf mktrf smb hml umd if month==1 & wficn == `id'
merge 1:1 wficn end using "`stats'", update replace
drop _merge
}
that is, we had at most 36 observations (there might be plenty of missings in returns or other variables used in the regression above during previous 36 months) to estimate each regression. How can we make sure there are enough observations to do this rolling regression? How to eliminate funds that had less than the 3 years of prior return history required for the estimation process.
But, by running the above code I got the following error message:
no observations
an error occurred when rolling executed regress
r(2000);
I also tried to use the following two sets of codes, also got error message:
1.
//1. USE rollreg
tsfill,full //neither tsfill nor (tsfill, full) works
rollreg mret_rf mktrf smb hml umd if month==1, move(36) stub(retM36)
2.
//2. USE
tsfill, full
qui rolling _b _se, window(36) saving(betas, replace) keep (yrm): reg mret_rf mktrf smb hml umd if month==1, r
Could you please help me ?
But in the literature, researchers usually used the risk-adjusted returns in their analysis.
We need to do the rolling regression with 36months as the moving window;
at the beginning of each calendar year, for each fund, estimate the following carhart model, using fund returns for the previous 36 months:
R-Rf = a + b1*mktrf +b2*smb +b3* hml + b4*umd+error term
In stata, my code is:
qui levelsof wficn, local(ids)
foreach id of local ids {
quietly: rolling, window(36) saving(`stats', replace) nodots: reg mret_rf mktrf smb hml umd if month==1 & wficn == `id'
merge 1:1 wficn end using "`stats'", update replace
drop _merge
}
that is, we had at most 36 observations (there might be plenty of missings in returns or other variables used in the regression above during previous 36 months) to estimate each regression. How can we make sure there are enough observations to do this rolling regression? How to eliminate funds that had less than the 3 years of prior return history required for the estimation process.
But, by running the above code I got the following error message:
no observations
an error occurred when rolling executed regress
r(2000);
I also tried to use the following two sets of codes, also got error message:
1.
//1. USE rollreg
tsfill,full //neither tsfill nor (tsfill, full) works
rollreg mret_rf mktrf smb hml umd if month==1, move(36) stub(retM36)
2.
//2. USE
tsfill, full
qui rolling _b _se, window(36) saving(betas, replace) keep (yrm): reg mret_rf mktrf smb hml umd if month==1, r
Could you please help me ?
Comment