If you are not yet familiar with asreg, here is a quick start. Implementing the Fama and MacBeth regression using asreg is super-fast and easy. Here are a few posts related to this implementation.
The Shanken Correction
In applying standard OLS formulas to a cross-sectional regression, we assume that the right-hand variables β are fixed. The β in the cross-sectional regressions are not fixed, of course, but are estimated in the time-series regression. Therefore, there might be a sampling error in the estimates of β. Shanken (1992) suggested a correction to the standard errors of the estimates.
How to do it?
The focus in this post is on the Fama and MacBeth implementation with Shanken () correction. Like with many other commands using asreg, the Shanken correction is fairly easy. The following steps are needed:
1. Find a covariance matrix among the right hand-side variables and write it to a matrix. Suppose variables inour dataset inlcude rm_rf smb and hml, then to find the covariance and write it to a matrix, we would do the following:
cor rm_rf smb hml, cov matrix S = r(C)
2. Find the first stage lambda of the RHS variables.
bys portfolios: asreg excess_returns rm_rf smb hml * Remove uncessary variables drop _Nobs _R2 _adjR2 _b_cons
3. Fama and MacBeth regression: In this last stage, we would use the fmb and shanken option. The shanken option requires the covariance matrix that we created in step 1 above
asreg excess_returns _b_mmrf _b_smb _b_hml , fmb shanken(S)
- Fama, E. F., & MacBeth, J. D. (1973). Risk, return, and equilibrium: Empirical tests. Journal of political economy, 81(3), 607-636.
- Shanken, J. (1992). On the estimation of beta-pricing models. The review of financial studies, 5(1), 1-33.