Asset pricing models are the models that are used to estimate the expected return of a stock. Different models are introduced for this purpose such as CAPM, Fama, and French 3-factor or 5-factor model and other factors have also been discussed in the literature. On this page, we have presented Stata or R codes for some of these models
Fama and French Three Factor Model in Stata
Eugene Fama and Kenneth French introduced the three-factor model. This model has two additional factors as compared to the CAPM model which was a single factor model. The following product contains the code that you can use to estimate Fama and French three-factor model in Stata. This code is specifically designed to use CRSP and Compustat data. We have also written detailed comments with each line of code explaining the reason for the code. Hence if you learn the code, you can apply it to different data sets that would not necessarily have to be CRSP/Compustat. Along with the code, you will also get dummy datasets that you can use to practice on the data, or if you have access to CRSP and Compustat, then you can download the relevant data.
Downside CAPM (DCAPM) in Stata
DCAPM models were introduced by Hogan and Warren (1974), Harlow and Roa (1989) and, Estrada (2002,2007). The following code uses all these three methods to estimate DCAPM in Stata. With the following download, you get the do file containing the code along with detailed comments on each line of code. You will also be provided with the dummy data to excecute the code.