*! version 1.1 20apr2026

Title

nace_to_ff -- Convert NACE Rev. 2 codes to Fama-French industry classifications

Syntax

nace_to_ff
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. The default is 48

labels apply value labels to the new variable

replace overwrite existing variable

diagnostics display NACE bridge diagnostics

tiegen(newvar) save tie indicator (1 if plurality tie blocked assignment)

unresolvedgen(newvar) save unresolved indicator (1 if no FF assignment)

Description

nace_to_ff maps NACE Rev. 2 class codes to Fama-French industries by
first bridging NACE Rev. 2 to ISIC Revision 4 through an official correspondence
table and then delegating classification to isic_to_ff.

Input normalization is class-level: values are treated as valid NACE Rev. 2
classes only when they normalize to numeric codes 100-9999. Leading-zero
and dotted class inputs (for example, 01.11 or 0111) are accepted and
normalized to 111. Values outside the class range are excluded from assignment.

Fractional numeric NACE inputs are rejected. If your data store formatted
codes with dots, punctuation, or leading zeros, keep them as strings and let
the string-cleaning path normalize them before class-level validation.

The NACE-to-ISIC bridge is one-to-one at the 4-digit class level. Any ambiguity
in FF assignment arises only in the inherited ISIC-to-FF step, where
isic_to_ff applies a plurality rule across linked FF industries.

This version supports NACE Revision 2 only. If support for later NACE
revisions is added, it will appear as a separate extension.

Options

generate(newvar) specifies the name of the new variable to be created.

scheme(#) selects the Fama-French scheme. Valid values are 5, 10, 12, 17,
30, 38, 48, and 49. The default is 48.

labels attaches value labels to the output variable.

replace permits overwriting existing variables.

diagnostics reports NACE bridge outcomes. These include cases that fail at
the NACE-to-ISIC step and cases that remain unresolved in the downstream ISIC step.

tiegen(newvar) saves a tie indicator. The variable equals 1 when a
plurality tie prevented assignment in the inherited ISIC-to-FF step.

unresolvedgen(newvar) saves an unresolved indicator. The variable equals 1
when no FF assignment is available after the NACE-to-ISIC and ISIC-to-FF steps.
This includes plurality ties inherited from the ISIC stage.

Stored results

nace_to_ff stores the following in r():

Scalars

r(N) observations in sample

r(N_nace) observations with valid normalized NACE code

r(N_ff_mapped) observations mapped to FF industry

r(N_tie) observations unresolved due to plurality tie

r(N_unresolved) observations unresolved overall

r(ff_map_rate) mapping rate among observations with valid NACE code (percent)

Macros

r(scheme) FF scheme used

r(revision) delegated ISIC revision used. Currently 4

r(nace_revision) NACE revision used. Currently 2

r(varname) name of generated variable

Remarks

The NACE bridge dataset is distributed with the package as
nace2_isic4_bridge.dta. The delegated ISIC bridge dataset is distributed as
isic4_naics17_bridge.dta. Both files must be discoverable on adopath.

nace_to_ff requires isic_to_ff and its downstream dependency
sic_to_ff version 1.1 or later. When labels is requested,
naics_to_ff must also be discoverable on adopath.

Examples

. nace_to_ff nace2, gen(ff48)

. nace_to_ff nace2, gen(ff48) labels diagnostics tiegen(nace_tie) unresolvedgen(nace_unres)

. nace_to_ff nace2, gen(ff17) scheme(17)

References

United Nations Statistics Division. Correspondence table between ISIC Rev. 4 and
NACE Rev. 2:
https://unstats.un.org/unsd/classifications/Econ/tables/ISIC/ISIC4_NACE2/ISIC4_NACE2.txt.

Eurostat RAMON. NACE Rev. 2 correspondence tables:
https://ec.europa.eu/eurostat/ramon/relations/index.cfm?TargetUrl=LST_REL&StrLanguageCode=EN&IntCurrentPage=1&StrNomRelCode=ISIC4%20-%20NACE2.

Author

Kelvin K.F. Law, Nanyang Business School, Nanyang Technological University, Singapore

klaw@ntu.edu.sg