Fama and French Model

Fama and French three factors model and Fama and French five factors model are widely used in the performance evaluations of stocks and portfolios and for the cost of equity calculations. While it is challenging to build its risk factors in conventional spreadsheet programs such as MS Excel, the job is relatively easier in programmable statistical software such as Stata and R. For this reason, we have developed efficient Stata codes to estimate Small minus Big (SMB), High minus Low (HML), left-hand side (LHS) portfolios and their returns, and other related tasks. These codes are easy to implement and understand or modify for unique problems.

GRS tests

We have also developed model testing codes that include Gibson, Ross, and Shanken (GRS) test in Stata, the Fama and French (2015) tests of the average absolute value of the intercepts, A|ai|, A|ai|/A|ri|, the average absolute value of the intercept ai over the average absolute value of ri , which is the average return on portfolio i minus the average of the portfolio returns, the average squared intercept over the average squared value of ri , corrected for sampling error in the numerator and denominator. Each of these tests are available for an additional fee of $49.99.

Is our code accurate?

The code has been tested for more than 10 times on different data sets and has been confirmed by different researchers. Further, the code produces virtually identical results as reported in the Fama and French papers, when applied on the data sets that are available on the Fama and French website.

For further pricing details of these codes, please contact at attaullah.shah@imsciences.edu.pk


The code is available with three options:

  • Bronze Package: This package, priced at 99 GBP, includes the Stata code, comments, and email support.
  • Silver Package: This package is priced at 149 GBP and includes the Stata code, example dataset, code comments, and email support.
  • Gold Package: This package is priced at 199 GBP. It included all features of the Silver package plus data preparation. The data preparation process involves importing data into Stata, merging various datasets, cleaning the data, and creating the required variables before executing the code.

Buy with PayPal Pay Now

Choose Package

Model Testing Tools

Our code library has a vast range of model testing tools that are available in the extant literature. These tools include:

  • GRS test (Barillas, Robotti, and Shanken (2020).
  • The average F-test (Hwang and Satchell (2014).
  • Intercept based test (Fama and French (2015)
  • Squared Sharpe Ratio (Barillas, Robotti, and Shanken 2020).

‏‏‎ ‎

Choose GRS Package

How the code is delivered

Once you have completed the payment, please send us an email with the payment reference. We will send the code within 24 hours. However, if you have purchased the Gold package package, we will contact you directly for.


  • 1 Barillas, F., Kan, R., Robotti, C., & Shanken, J. (2020). Model comparison with Sharpe ratios. Journal of Financial and Quantitative Analysis, 55(6), 1840-1874.
  • 2 Carhart, Mark M, 1997. “On Persistence in Mutual Fund Performance,” Journal of Finance, American Finance Association, vol. 52(1), pages 57-82, March.
  • 3Fama, E.F. and French, K.R. (1993) Common Risk Factors in the Returns on Stocks and Bonds. Journal of Financial Economics, 33, 3-56. https://doi.org/10.1016/0304-405X(93)90023-5
  • 4Fama, E. F., & French, K. R. (2015). A five-factor asset pricing model. Journal of financial economics, 116(1), 1-22.
  • 5Gibbons, M. R., Ross, S. A., & Shanken, J. (1989). A test of the efficiency of a given portfolio. Econometrica: Journal of the Econometric Society, 1121-1152.
  • 6Hwang, S., & Satchell, S. E. (2014). Testing linear factor models on individual stocks using the average F-test. The European Journal of Finance, 20(5), 463-498.
  • 7Sharpe, W.F. (1994) The Sharpe Ratio. The Journal of Portfolio Management, 21, 49-58. http://dx.doi.org/10.3905/jpm.1994.409501
  • ‏‏‎ ‎