Cost of Equity with the CAPM and the Fama and French Three Factor Model

In this project, we calculated the cost of equity using CAPM and Fama and French model using the APT method.
Details and steps of the project include:

  1. Importing different files from Excel
  2. Used Rolling regressions with one-year, 3-years, and 5-years windows to get factor loadings
  3. Calculated the long-run average risk premiums of the factors
  4. Factor loadings and long-run risk premiums were used to find forecasted cost of equity
  5. Then calculated the absolute difference between actual returns and the forecasted cost of equity
  6. These absolute forecast errors were then averaged across one-month, one-year, 3-years, and 5-years periods
  7. Made Word Tables for each of the above averages for each firm
  8. Several variations were tried for the above using decile portfolios etc.
  9. Next Variation included the creation of the type portfolios, i.e. industry portfolios etc.
  10. Next Variation included the creation of a single portfolio for all firms.
  11. Further, the project also created summary statistics tables for individual firms,
    decile, type and all portfolios.
  12. Additional variations are possible e.g, report the cost of equity by firm-year, portfolio-year, etc.


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 purposeis 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 with some example data.
For further details, please contact us at:



Project tags: Initial Public offerings, IPO, Fama and French, BHAR, CAR, cumulative abnormal returns, market adjusted returns, event study, Stata , FinTechprofessor