*! version 1.1 15dec2025

Title

sic_to_ff -- Convert SIC codes to Fama-French industry classifications

Syntax

sic_to_ff
varname
[varname]
[if] [in]
, generate(newvar) [options]

Required
generate(newvar) name of new variable to create

Optional
scheme(#) industry classification scheme: 5, 10, 12, 17, 30, 38, 48, or 49; default is 48

labels apply value labels to the new variable

replace overwrite existing variable

nomissing force all valid SICs into an industry (assign unmapped to Other)

If two variables are specified, the first is used as the primary SIC and the
second as a fallback when the primary is missing. This is useful for Compustat
data where sich (historical SIC) is preferred but sic can fill gaps.

Description

sic_to_ff converts Standard Industrial Classification (SIC) codes to
Fama-French industry classifications. The command supports all major
Fama-French industry classification schemes: FF5, FF10, FF12, FF17, FF30,
FF38, FF48, and FF49.

The command accepts both numeric and string SIC codes. String SIC codes are
automatically converted to numeric values. Non-numeric strings (e.g., "XXXX")
are treated as missing.

The Fama-French industry classifications are widely used in empirical
accounting and finance research to group firms by industry. These
classifications are based on four-digit SIC codes and are maintained by
Kenneth R. French on his data library website.

Options

Required

generate(newvar) specifies the name of the new variable to be created
containing the Fama-French industry code.

Optional

scheme(#) specifies which Fama-French industry classification scheme
to use. Valid values are 5, 10, 12, 17, 30, 38, 48, or 49. The default is 48,
which is the most commonly used classification in the literature.

labels attaches value labels to the new variable, showing the standard
Fama-French industry abbreviations (e.g., "Agric", "Food", "Hlth").

replace permits sic_to_ff to overwrite an existing variable.

nomissing forces all observations with valid SIC codes into an industry
classification. Without this option, SIC codes that do not match any explicit
range in Ken French's definitions remain missing for FF17, FF30, FF38, FF48,
and FF49 schemes. With this option, unmapped SICs are assigned to "Other".
FF5, FF10, and FF12 always use catch-all "Other" behavior regardless of this option.

Remarks

Using sich and sic from Compustat

In Compustat, there are two SIC variables:

sich Standard Industrial Classification - Historical (numeric).
Reflects the SIC code at the time of the fiscal year-end. Preferred for research
but has more missing values.

sic Standard Industry Classification Code (string).
Current/header SIC code. More complete but may not reflect historical classification.

Best practice is to use sich as the primary variable with sic as fallback:

. sic_to_ff sich sic, gen(ff48) labels

This uses sich when available and falls back to sic only when sich
is missing. The command reports how many observations were filled using the
fallback variable.

Handling of unmapped SIC codes

Ken French's industry classification files define "Other" using explicit SIC
ranges for the 17, 30, 48, and 49 industry schemes. SIC codes outside these
defined ranges are technically unclassified.

By default, sic_to_ff respects this behavior: for FF17/30/38/48/49,
SIC codes that do not match any explicit range are left as missing. This
matches Ken French's original methodology.

The nomissing option changes this behavior to assign all unmapped SICs
to "Other", which is useful when you need complete industry coverage. This
is similar to the behavior of some other implementations (e.g., ffind
with the nomiss option).

For FF5, FF10, and FF12, all valid SICs are always assigned to some industry
(including "Other" as a catch-all), regardless of the nomissing option.

Examples

Basic usage with FF48 (default):

. sic_to_ff sic, gen(ff48)

Using FF12 classification with labels:

. sic_to_ff sic, gen(ff12) scheme(12) labels

Using FF49 with Software industry:

. sic_to_ff sic, gen(ff49) scheme(49) labels

Force all SICs into industries (no missing):

. sic_to_ff sic, gen(ff48_all) scheme(48) labels nomissing

Replace existing variable:

. sic_to_ff siccd, gen(ff_ind) scheme(48) labels replace

Create multiple classifications:

. sic_to_ff sic, gen(ff48) scheme(48) labels

. sic_to_ff sic, gen(ff12) scheme(12) labels

. sic_to_ff sic, gen(ff5) scheme(5) labels

Use with Compustat data:

. use compustat_annual, clear

. sic_to_ff sich, gen(ff48) labels

Use sich as primary, sic as fallback when sich is missing:

. sic_to_ff sich sic, gen(ff48) labels

Works with string SIC codes too:

. sic_to_ff sic_str, gen(ff48) labels

Industry Classification Schemes

The following schemes are available:

Scheme Description

5 Consumer, Manufacturing, High-Tech, Health, Other

10 Consumer NonDurables, Consumer Durables, Manufacturing, Energy,
High-Tech, Telecom, Shops, Health, Utilities, Other

12 Adds Chemicals, Business Equipment, and Finance to FF10

17 More granular breakdown including Food, Mining, Oil, Construction

30 Detailed classification with 30 industries

38 Simple 2-digit SIC-based classification (37 industries + Other)

48 Most commonly used comprehensive 48-industry classification

49 FF48 plus Computer Software industry (industries renumbered)

FF48 Industry Names:

1 Agric (Agriculture)

2 Food (Food Products)

3 Soda (Candy and Soda)

4 Beer (Beer and Liquor)

5 Smoke (Tobacco Products)

6 Toys (Recreation)

7 Fun (Entertainment)

8 Books (Printing and Publishing)

9 Hshld (Consumer Goods)

10 Clths (Apparel)

11 Hlth (Healthcare)

12 MedEq (Medical Equipment)

13 Drugs (Pharmaceutical Products)

14 Chems (Chemicals)

15 Rubbr (Rubber and Plastic Products)

16 Txtls (Textiles)

17 BldMt (Construction Materials)

18 Cnstr (Construction)

19 Steel (Steel Works)

20 FabPr (Fabricated Products)

21 Mach (Machinery)

22 ElcEq (Electrical Equipment)

23 Autos (Automobiles and Trucks)

24 Aero (Aircraft)

25 Ships (Shipbuilding, Railroad Equipment)

26 Guns (Defense)

27 Gold (Precious Metals)

28 Mines (Non-Metallic Mining)

29 Coal

30 Oil (Petroleum and Natural Gas)

31 Util (Utilities)

32 Telcm (Communication)

33 PerSv (Personal Services)

34 BusSv (Business Services)

35 Comps (Computers)

36 Chips (Electronic Equipment)

37 LabEq (Measuring and Control Equipment)

38 Paper (Business Supplies)

39 Boxes (Shipping Containers)

40 Trans (Transportation)

41 Whlsl (Wholesale)

42 Rtail (Retail)

43 Meals (Restaurants, Hotels, Motels)

44 Banks (Banking)

45 Insur (Insurance)

46 RlEst (Real Estate)

47 Fin (Trading)

48 Other

FF49 differs from FF48 by adding a Computer Software industry (Softw) at
position 36, which includes SIC codes 7370-7373 and 7375 (carved out from
BusSv and Comps). Note that SIC 7374 (Computer Processing) remains in BusSv.
Industry 35 is relabeled from "Comps" to "Hardw" (Hardware) in FF49, reflecting
that Software has been separated out. All subsequent industries are renumbered:
Chips becomes 37, LabEq becomes 38, etc., and Other becomes industry 49.

Technical Notes

SIC code handling

1. Both numeric and string SIC variables are accepted. String values are
converted using Stata's real() function.

2. SIC codes outside the valid range (0-9999), non-integer values, or
non-numeric strings result in missing industry classifications.

Notable classification decisions

3. SIC 3622 (Industrial Controls) handling varies by scheme: In FF5
and FF10, 3622 is explicitly assigned to High-Tech (carved out from Manuf).
In FF12, 3622 remains in Manufacturing per Ken French's definition. In FF48,
3622 is assigned to Chips (Electronic Equipment).

4. FF49 Software industry includes SIC 7370-7373 and 7375. Note that
SIC 7374 (Computer Processing) remains in Business Services per Ken French's
specification.

5. Unmapped SIC codes are handled differently by scheme: FF5/10/12
always assign unmapped codes to "Other", consistent with these being aggregate
schemes. FF17/30/38/48/49 leave unmapped codes as missing by default (per Ken
French's methodology), unless the nomissing option is specified.

6. FF38 is Ken French's simple 2-digit SIC-based classification,
where industries correspond roughly to SIC major groups (e.g., Food = 2000-2099,
Chemicals = 2800-2899). This is distinct from the more detailed FF48 scheme
that uses precise 4-digit SIC ranges.

Installation

To install sic_to_ff, place both files in your personal ado directory:

1. Find your personal ado directory by typing in Stata:

. sysdir

Look for the PLUS or PERSONAL directory path.

2. Copy the files to that directory:

sic_to_ff.ado

sic_to_ff.sthlp

Typical locations:

Windows C:\ado\plus\s\

Mac /Users/username/Library/Application Support/Stata/ado/plus/s/

Linux ~/ado/plus/s/

Note: Place files in the s subdirectory (first letter of the command name).
Create the subdirectory if it does not exist.

3. Verify installation:

. which sic_to_ff

. help sic_to_ff

References

Fama, Eugene F., and Kenneth R. French. 1997. "Industry Costs of Equity."
Journal of Financial Economics 43(2): 153-193.

Kenneth R. French Data Library:
https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html

Author

Kelvin Law

Nanyang Business School

Nanyang Technological University

Singapore

Comments and suggestions are welcome.

Also see

Manual: [D] generate, [D] encode

Online: generate, encode, label