Skip to content
All library documents

Constructing Fama–French Factors from Stock and Accounting Data

Article Quant Q&A · Author: Taylor

Summary

The document outlines practical inputs and sample rules for calculating the Fama–French factors. It gives example Compustat formulas for book equity, operating profitability, market equity, and the book-to-market ratio, then describes how to form portfolios using accounting data from the prior fiscal year. It also distinguishes the broad stock universe used for the market factor from the NYSE firms used to set portfolio breakpoints.

The guidance emphasizes implementation details that can materially affect results: deferred taxes change book equity, eligible securities are restricted by share code, and accounting data must be lagged when assigning portfolios. It recommends comparing computed market equity and book equity breakpoints with the published data library as a sanity check. The post points to canonical research and methodology materials, but it does not provide a complete, precise recipe for every factor. In particular, it does not spell out the momentum calculation, and the snippets should be checked against current canonical definitions before use.

Key ideas

  • Book equity can be calculated from stockholders’ equity, preferred stock, and deferred taxes.
  • Market equity and book-to-market ratios depend on consistent accounting and price data.
  • Portfolio formation uses prior fiscal-year accounting information with a lag.
  • NYSE firms determine breakpoints, while the market factor uses a broader exchange universe.
  • Published breakpoints can help validate the security universe and calculations.

Tags

Full text
# How to calculate Fama-French factors?


# How to calculate Fama-French factors?












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?

## Answer by Matthew Gunn (score 5, accepted)

https://quant.stackexchange.com/a/35743

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...

- Limit the universe to CRSP sharecd 10 and 11.

- For breakpoint calculations, limit it to the New York Stock Exchange.

- "Rm-Rf includes all NYSE, AMEX, and NASDAQ firms. SMB and HML for July of year t to June of t+1 include all NYSE, AMEX, and NASDAQ stocks for which we have market equity data for December of t-1 and June of t, and (positive) book equity data for t-1."

- Form portfolios in June based upon accounting data for the prior fiscal year. Thus the accounting data is at least six months old and possibly a year old.

- I recall there may be some small, additional checks for good price data.

#### 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:

http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html

## Answer by Alexander Didenko (score 1)

https://quant.stackexchange.com/a/35751

Canonical references are

- Fama-French: https://www.jstor.org/stable/2329112

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.