Project’s Overview

In this project, we replicated the paper ” Variation of Economic Risk Premiums”. Details related to this project include:

  1. Importing different files from Excel
  2. Reshaping the data to a long format
  3. Merging different datasets
  4. Finding summary statistics for the variables
  5. To replicate Table 5, first rolling betas are calculated for a set of size, and bond portfolios, and also for industry, size, and bond portfolios.
  6. Using Fama and MacBeth type regression, the rolling betas are then used to find the risk premium estimates
  7. The t-values are then calculated from the monthly Fama-MacBeth regressions coefficients
  8. The procedure is repeated for bivariate and multivariate models.
  9. To replicate Table 6, first rolling betas are calculated for a set of size, and bond portfolios, and also for industry, size, and bond portfolios.
  10. Then the second stage regressons are
    estimated by regressing portfolio returns on the first stage betas, storing the periodic exposures of the portfolios to risk factors,
  11. Then the risk-premiums are regressed on the lagged instrumental variables (economic variables)
  12. The above steps are repeated using bivariate and multivariate models
  13. Table 7 of the paper decomposes predictable variations of the returns. The following coding activitie were needed.
  14. Excess returns of the given portfolios are regressed on the lagged instruments.
  15. Then sample variance of the fitted values is calculated
  16. Then the model’s sample variance of the fitted values is calculated from regressing risk-premiums on the instruments
  17. A ratio called VR1 is calculated, dividing by the variance of the fitted values of the excess return
  18. The predictable component of a return that is not captured by the model is measured as the sample variance of the fitted values. This variance is also
    expressed as a ratio, VR2, relative to the total variance of the fitted expected return.
  19. The VR1 and VR2 ratios are calculated for all portfolios with and without January Dummy.


Our Stata Code

We have developed easy to use yet robust codes for the above steps. The codes need just a basic understanding of Stata. Further, our comments on each line of code will surely help you in running the code as well as in understanding the process more clearly. We normally share all Stata files, the raw data files, and Stata codes with comments. The purpose is to help researchers to learn and apply these codes on their own. We also try to answer questions that might arise at a later stage when the researcher applies these codes.



The code is available for $ $299, plus a $50 for raw data processing (in case the data is not in Stata format and variables are not already constructed). For further details, please contact us at:



See our full list of completed projects


Project tags: Variation Economic Risk Premium,
Wayne E. Ferson, Campbell R. Harvey, VR1, VR2, Stata, FinTechprofessor,
conditional CAPM, Multi beta models, conditional betas, replication, stock
return predictability, r capturing predictable variation of the stock
portfolios, rational asset pricing model, sensitivity to economic