← Investment

R&D Intensity Curated

Research and development spending scaled by assets or revenue. Often set to zero where a firm reports none.

Textbook formula: R&D Expense / Total Assets (or Sales)
Curated note

R&D expense scaled by total assets or by sales. Scaling by sales is the innovation-literature convention (R&D per dollar of revenue); scaling by assets matches the other balance-sheet controls in a regression. The decisive choice is what happens when R&D expense is missing — most firms do not report it — and a third of these packages set it to zero, some with an indicator for the originally-missing rows (see Missing observations).

  • R&D expense / total assets — R&D as a control alongside other asset-scaled ratios
  • R&D expense / sales — innovation studies: R&D per dollar of sales
  • R&D expense / lagged total assets — R&D as an investment flow over beginning-of-year assets
108
replication packages compute it
11
distinct measurements, written 41 ways
43%
of packages read winsorize or trim it

How the code actually computes it

Each row is one measurement. The many ways code writes a lagged value are one measurement, quarterly items are the annual measurement at quarterly frequency, and percent / log / rescaling are tags, not new measurements. Open a row for the spellings, each shown as written in its example.

R&D expense / total assets 59 packages
annual 51 · quarterly 7 · 12 spellingsmissing → 0 · 2
Spelling in the code, as writtenFrequencyPackages
xrd/at annual46
xrdq/atq quarterly5
xrd2/at annual2
(xrd) / at annual1
RDX/at annual1
replace_na(xrdq,0)/BAmissing → 0 quarterly1
sum(xrd,0)/atmissing → 0 annual1
temp_xrd / at annual1
xrd/atq mixed1
xrdq/at mixed1
xrdq/atq1 quarterly1
xrdqw/atq quarterly1
gen xrd2at=xrd2/at
R&D expense / sales 42 packages
annual 40 · quarterly 3 · 7 spellingsused lagged · 1
Spelling in the code, as writtenFrequencyPackages
XRD/Sale annual36
xrdq/saleq quarterly3
l.xrd/l.saleused lagged annual1
rndexp/sale annual1
xrd/asale annual1
xrd/sale_x annual1
xrd_new/abs(sale) annual1
RDS=XRD/Sale;
R&D expense / lagged total assets 17 packages
annual 17 · quarterly 2 · 10 spellings
Spelling in the code, as writtenFrequencyPackages
xrd/L.at annual9
xrd/l1at annual2
xrdq/l.atq quarterly2
RDX/L.at annual1
XRD./Lag_AT annual1
xrd/at_lag annual1
xrd / l1_at annual1
xrd/l_at annual1
xrd/lag_at annual1
xrd0/at_lag1 annual1
Example: stata · 01_Data.do:605 · pkg 257
gen RD = xrd/L.at    if   xrd!=0            // R&D
R&D expense / revenue 4 packages
annual 2 · quarterly 2 · 3 spellings
Spelling in the code, as writtenFrequencyPackages
xrdq/revtq quarterly2
xrd/revt annual1
xrd_mi/revt annual1
xrd/revt as rnd,
ib/at as roa,
dltt/at as levbook,
2*(PRCH_F-PRCL_F)/(PRCH_F+PRCL_F) as uncert

from comp.funda
where INDFMT= 'INDL'
and DATAFMT='STD' …
R&D expense / average total assets 2 packages
annual 2 · quarterly 0 · 2 spellings
Spelling in the code, as writtenFrequencyPackages
2*xrd_0 / (at_0+at_l1) annual1
xrd / ((at + L.at) / 2) annual1
Example: sas · GGM_2018_code.sas:531 · pkg 12556
xrd_scale_0 = 2*xrd_0 / (at_0+at_l1);
R&D expense / lagged sales 2 packages
annual 2 · quarterly 0 · 2 spellings
Spelling in the code, as writtenFrequencyPackages
xrd/l.sale annual1
xrd/lag_sale annual1
rd_sales = xrd/lag_sale;
(0.2 × R&D expense lagged 6 periods + 0.4 × R&D expense lagged 5 periods + 0.6 × R&D expense lagged 4 periods + 0.8 × R&D expense lagged 3 periods + R&D expense lagged 2 periods) / total assets 1 package
annual 1 · quarterly 0 · 1 spelling
Spelling in the code, as writtenFrequencyPackages
rnd_capital /at annual1
Example: stata · Table8.do:43 · pkg 303
gen rnd_capital_at = rnd_capital /at
(lagged R&D expense + R&D expense lagged 2 periods + R&D expense lagged 3 periods + R&D expense lagged 4 periods + R&D expense) / lagged total assets 1 package
annual 1 · quarterly 0 · 1 spelling
Spelling in the code, as writtenFrequencyPackages
(xrd+l.xrd+l2.xrd+l3.xrd+l4.xrd)/L.at annual1
gen l_rd_5yr=(xrd+l.xrd+l2.xrd+l3.xrd+l4.xrd)/L.at
(lagged R&D expense + R&D expense lagged 2 periods + R&D expense) / lagged total assets 1 package
annual 1 · quarterly 0 · 1 spelling
Spelling in the code, as writtenFrequencyPackages
(xrd+l.xrd+l2.xrd)/L.at annual1
gen l_rd_3yr=(xrd+l.xrd+l2.xrd)/L.at
R&D expense.fillna(0) / lagged total assets 1 package
annual 1 · quarterly 0 · 1 spelling
Spelling in the code, as writtenFrequencyPackages
comp['xrd'].fillna(0) / comp['AT_lag'] annual1
Example: python · main_code.py:704 · pkg 252456
comp['R_D'] = comp['xrd'].fillna(0) / comp['AT_lag']
R&D expense.fillna(0) / sales 1 package
annual 1 · quarterly 0 · 1 spelling
Spelling in the code, as writtenFrequencyPackages
comp['xrd'].fillna(0) / comp['sale'] annual1
Example: python · main_code.py:727 · pkg 252456
comp['RD_INTENSITY'] = comp['xrd'].fillna(0) / comp['sale']

Missing observations

Among the 107 of 108 packages we have read: what the code does when this measure, or an input it is built from, is missing. A package can do more than one.

29 · 27%
Drop the observation
rows with the measure or an input missing are deleted
at (44), atq (14), sale (9), rdat (4), xrd_to_assets (4)
drop if at==.
31 · 29%
Set missing to 0
an imputation: missing read as zero (typical for R&D)
xrd (43), rd (28), rd1 (4), rd_at (2), rndexp (1)
replace rd=0 if missing(rd)
8 · 7%
Fill from elsewhere
an alternative definition, another source, a carried or interpolated value
rd_sale (5), at (5), sale (2), randd (1), xrd (1)
replace `v' = `v'[_n-1] if missing(`v') & nace2_4 == nace2_4[_n-1]
54 · 50%
Nothing explicit
missing values fall out in estimation (listwise)

2 package(s) also read missing as zero inside the formula itself (na0(), sum(x, 0), nansum) — tagged missing → 0 on the spellings above.

Outliers: winsorizing and trimming

46 of the 107 packages we have read (43%) winsorize or trim this variable — 1 of them trim (delete) rather than winsorize; 12 do it within groups (by year, typically). The rest leave it as computed.

Cuts are percentiles (1/99 = the 1st and 99th). "default cuts" = the command's default, e.g. winsor2 uses 1/99. A package that cuts the variable two ways counts once under each.

Used as outcome vs control

Of the packages that compute this measure and put its variable in a model, how many estimate it as the outcome (dependent variable) and how many use it as a regressor (a control, or the variable of interest) — in all their estimations, and within each design's models. A package can do both; one count per package.

modelspackages outcome ▮ vs regressor ▮as outcomeas regressor
all estimations 26
31% · 8
39 models
4 outcome models in the code
81% · 21
543 models
4 regressor models in the code
Difference-in-differences 3
33% · 1
1 models
1 outcome model in the code
67% · 2
19 models
2 regressor models in the code
  • ESG Shocks in Global Supply Chains Review of Financial Studies 2026 · pkg 266
    qui eststo: reghdfe Dtrade  treatpost  post  $x  if poissonsample==1,ab(pair indyear case  ) cl(case#shppanjivaid)
    As we read it — macros filled in / loop expanded (an interpretation, not the file's text):
    qui eststo: reghdfe Dtrade treatpost post size mtb lev rd invest cash if poissonsample==1,ab(pair indyear case ) cl(case#shppanjivaid)
  • Reciprocity in Corporate Tax Compliance—Evidence from Ozone Pollution Journal of Accounting Research 2023 · pkg 12662
    CFHLL_stata.do:380 · c.reg2##(c.median_income c.income_inequality c.education c.age c.urban c.rel c.social_capital c.statetaxrate c.temp c.wind c.dptemp c.prec1 c.cloud c.roa c.lev c.nol c.change_nol c.foreign_income c.equity_income c.ppe c.intangible c.rd c.ads c.sga c.size c.mb c.instown_perc)
    qui xi: reghdfe cash_etr3 c.treat##c.post c.reg2##(c.median_income c.income_inequality c.education c.age c.urban c.rel c.social_capital c.statetaxrate c.temp c.wind c.dptemp c.prec1 c.cloud c.roa c.le …
Matching 2
0% · 0
0 models
100% · 2
13 models
2 regressor models in the code
Panel fixed effects 13
38% · 5
26 models
4 outcome models in the code
77% · 10
321 models
4 regressor models in the code

A lag of the outcome on its own right-hand side (roa on L.roa) is not counted as a regressor use. A measure found by its estimation, formula or data source (a CAR summed over an event window, a beta kept from a regression, a KZ index) is looked up by the variable that code produces (car126d_ff4, beta); a generic output such as _rmse or resid is not. Designs are the recipe designs; "all estimations" covers every model in the package.

As a regressor (control or variable of interest)
In those models, counted in packages:
Fixed effects: gvkey (8), fyear (6), year (4), gvkey2 (2), permno (2), sic (2)
Clustering: gvkey (8), permno (3), analys (1), case#permno (1), case#shppanjivaid (1), cik (1)
Estimators: panel_fe (14), ols (6), count (4), binary (3), matching (2)
As the outcome (dependent variable)
In those models, counted in packages:
Fixed effects: gvkey (2), gvkey2 (2), case (1), firmid (1), firmsic3#year (1), gvkeyn (1)
Clustering: gvkey (3), analys (1), firmid (1), fyear (1), gvkey2 (1), gvkeyn (1)
Estimators: ols (5), panel_fe (5)

Foundational works

What the papers whose code computes this measure cite most (share of those papers citing each).

Papers whose code computes it