How do I calculate the three factors? The first "market" factor seems straightforward. However the SmB and the HmL factors seem to require accounting data. Also, how does one calculate the momentum factor? Can you write down explicit formulas with clearly defined notation, or provide a reference that describes the canonical calculations?

  • 1
    $\begingroup$ To calculate Fama French factors as Fama and French do, you'll need CRSP stock market data and Compustat accounting data. Between their papers and Ken French's website, they're fairly clear. $\endgroup$ Aug 22, 2017 at 19:37
  • $\begingroup$ @MatthewGunn which paper is this? $\endgroup$
    – Taylor
    Aug 22, 2017 at 20:48
  • $\begingroup$ @MatthewGunn also, it is still possible to replicate their calculations even if the data is coming from a different source. I am interested in formulas, and if nobody is willing to provide that, then a specific title of the paper. Then maybe I'll write up something myself. $\endgroup$
    – Taylor
    Aug 22, 2017 at 21:15
  • $\begingroup$ The tricky part if you're coming at it from a different data source is matching their universe of stocks precisely. $\endgroup$ Aug 22, 2017 at 21:18
  • $\begingroup$ @MatthewGunn ah I can see how that'd be a problem $\endgroup$
    – Taylor
    Aug 22, 2017 at 21:22

2 Answers 2


I don't have time to give you a complete, precise answer, but this may help you get going. I'm pulling stuff from various notes I have in places. It's a bit trickier than someone naively might think.

Ken French's description of their methodology:

The details section of various points in their data library has a bunch of material.

You may also look for papers where Fama and French discuss their three or five factor model. For the three factor model, you might look at "Common Risk Factors in the Returns on Stocks and Bonds," 1993, Journal of Financial Economic.

Some Compustat calculations to get you going:

  • The SQL code I have to calculate book equity from the Compustat annual file is: seq - COALESCE(pstk, 0) + COALESCE(txditc, 0) as be. (Be aware that the last part, adding back deferred taxes txditc has a substantial effect.)
  • The SQL code I used to calculate operating profitability is (revt - cogs - COALESCE(tie,0) - COALESCE(xsga,0)) as op_numerator
  • Market equity I calculate as csho * prcc_f as me.
  • The book to market ratio would then be CASE WHEN (me is NULL) OR (me = 0) THEN NULL ELSE be /me END as beme
  • Find some Compustat manual to find what those variables are.

CRSP calculations and getting the universe right...

Sanity checks:

You can see if you're computing market equity, book equity, etc... and oper ating in the same universe of securities by checking whether you can match the percentile breakpoints they compute:



Canonical references are


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.