← Methods The instrumental variables recipe →

Instrumental variables

1,899
packages in the design · 1,887 papers
1,799
of them have a model that shows the design itself — the models read below. For IV that is an estimation with an excluded instrument, so these are also exactly the packages that run a dedicated IV estimator (41,330 estimations)
How the design is counted — the same count on the recipe, outcomes and methods pages
  • The universe is every replication package our extractors have read (code_model_design) that is linked to a live paper by a confirmed link; the field is the linked paper's.
  • A package is in a design when (a) our extractor found the design's identification pattern on a line of code it runs (not a path, a folder macro, an export or an install line), or (b) it runs a model of the design's own estimator family. An ivreg2 / ivreghdfe call with no (endog = z) group counts for neither: it is OLS with robust or HAC errors, not IV.
  • Panel fixed effects is the rest: a fixed-effects estimation and none of the other designs. A package can be in several designs (not panel FE).
  • A model is an estimation OF the design only when the model itself carries the design's signature; the recipe's estimation choices, the outcomes, the instruments and every example are read from those models.
  • This design's signature in a model: an excluded instrument: an (endog = z) group, an instrument list, or R's ivreg(y ~ x | z) / felm(... | d ~ z).
  • 1,421 packages declare the design in code; 1799 are in it by their estimator (a package can be both).

Adoption over time — the dedicated estimator

2005: 1 of 3 packages (33.3%) — fewer than 10 packages that year 2005 2010: 12 of 34 packages (35.3%) 2010 2011: 20 of 77 packages (26.0%) 2012: 18 of 63 packages (28.6%) 2013: 25 of 107 packages (23.4%) 2014: 25 of 107 packages (23.4%) 2015: 45 of 156 packages (28.8%) 2015 2016: 20 of 105 packages (19.0%) 2017: 23 of 121 packages (19.0%) 2018: 36 of 151 packages (23.8%) 2019: 59 of 253 packages (23.3%) 2020: 60 of 246 packages (24.4%) 2020 2021: 82 of 392 packages (20.9%) 2022: 177 of 775 packages (22.8%) 2023: 233 of 909 packages (25.6%) 2024: 301 of 1,136 packages (26.5%) 2025: 315 of 1,322 packages (23.8%) 2025 2026: 342 of 1,459 packages (23.4%)

Share of each publication year's packages with parsed models that run this estimator at least once (hover for counts). Grey years have fewer than 10 packages and are not a trend; package coverage is thin before ~2010, when journal data policies began.

Validation practice

Of the 1,899 packages in the design, how many run each standard check (read from the code; the same checks and numbers as the recipe). A check run under a macro or in a file we could not read is missed, so these are lower bounds. Greyed: fewer than 10 packages.

first-stage / weak-instrument F reported
47% · 893
weak-IV-robust inference (weakiv, AR tests)
3% · 62
over-identification test (Hansen J / Sargan)
8% · 143
multiple-testing correction (FDR, Romano-Wolf, ...)
6% · 108

What it is used to study

The dependent variables of this design's estimations, read from the model roles we read from the code. Of the 1,899 packages in the design, 1,799 have a model that shows the design itself, and 1,666 of those have a readable outcome (41,330 models; for 466 packages some outcome is read only through a loop's expansion). Shares are of those 1,666 packages, one count per package; greyed rows rest on fewer than 10. An outcome that is a taxonomy measure's variable in the same package is shown as the measure; other names are grouped by what they name. Compare every design →

How this is counted
  • The unit is the package: a package counts once for an outcome, measure or instrument type however many of its models carry it; the model count is shown second.
  • A design's packages are the ONE design membership every page shows (identification fact on a line of code, or the design's own estimator). Its models are the ones that carry the design's signature in the model itself — a DiD estimator or a treatment × post term, event-time dummies or an abnormal-return outcome, an excluded instrument, an RD estimator or a bandwidth around a cutoff, a matching estimator or matched weights. A package with none of those models is counted in the design but has no outcome here.
  • Roles are read from each model's literal row. Only where a literal role still holds a macro (`y', $dep) are the loop-expanded rows written on the same line read for that role; an expanded row whose literal row is resolved adds nothing, and an unresolved role with no expansion is dropped.
  • An outcome is a taxonomy measure when the dependent variable is that measure's variable in the same package; otherwise it is grouped by its name (a word list, field-aware for short names like car, q, ret); otherwise it is shown as the bare variable.
  • Instruments are the EXCLUDED ones: a term also among the model's regressors is an included control. Types are read from the name (and L. / lag for lagged values). Where the name says nothing (`z`, `shock`, `iv1`), the instrument is traced to the statement in the package that builds it, up to three statements back, and typed by that statement's shape — (total − own)/(n − 1) a leave-out mean, L.x or x[_n-1] a lag, predict after a model a predicted value, a by-group sum of share × shock a shift-share, geodist a distance — or by the name of the one variable it copies or transforms. Products, thresholds and aggregates of other variables are not read, and an instrument nothing reliable types stays untyped. Each such example shows the statement, linked to its line.

Finance — 214 of 241 packages have a readable outcome

Economics — 1436 of 1,642 packages have a readable outcome

Outcomes that are taxonomy measures (all fields: the package computes the measure and estimates it as the outcome)

Commonest outcome names no group reads (all fields, packages): y1 (9), y2 (6), a (5), w (5), y0 (5), delta (4), ln_value (4), q (4), temp (4), dy (3), f15cumuly (3), f1cumuly (3).

Instruments and endogenous regressors

Excluded instruments in 1,747 of the 1,899 IV packages — those where we read an instrument list (40,305 models) — typed by how they are written, or, where the name says nothing, by the statement in the package that builds them (165 package–type pairs, each example linked to that statement). A term also listed among the model's regressors is an included control, not an instrument. Most instruments carry a name only their paper explains (g, exp0newsy) and are built from several variables at once, so the types below are lower bounds.

Instrument types (share of the 1747)

1441 packages (82%) have an instrument no type reads, e.g. elasticity, shock, D, T, distM_UK, g.

Endogenous regressors (share of the 1732 naming one)

1522 packages name an endogenous regressor no group reads, e.g. m, inter, lx, m2, mainVar, x1.

Instrument types by field (share of the field's IV packages with an instrument list; greyed: fewer than 10 packages)

typefinance (222)economics (1509)
other names 86% · 192 82% · 1237
lagged values (L.x, lag_x) 13% · 28 13% · 194
named only as an instrument (iv, z, inst ...) 8% · 18 9% · 133
randomized assignment / lottery / offer 4% · 8 7% · 106
prices / costs / tariffs / exchange rates 4% · 9 4% · 56
distance / geography 1% · 3 4% · 55
simulated / predicted values 2% · 4 3% · 51
historical / colonial conditions 0% 3% · 46
leave-out / peer averages 2% · 4 3% · 40
shift-share / Bartik exposure 3% · 6 2% · 35
eligibility / policy rule / cutoff 2% · 4 2% · 35
weather / natural shocks 0% 1% · 22
judge / examiner / caseworker leniency 0% 1% · 14
birth timing / sibling composition 0% 0% · 4

Commands (of the 1,799 packages running the dedicated estimator)

  • ivreg2646
  • ivreghdfe622
  • ivregress425
  • ivreg193
  • xtivreg2148
  • xtivreg79
  • feols41
  • felm34

Inference (of the 1,799 packages running the dedicated estimator)

  • cluster1311
  • default450
  • robust417
  • newey_west27
  • bootstrap24
  • hac9
  • jackknife2
  • conley1

Clustering variables (of the 1,799 packages running the dedicated estimator)

  • id76
  • state33
  • year33
  • fips22
  • county18
  • statefip18
  • date15
  • gvkey13

Absorbed fixed effects (of the 1,799 packages running the dedicated estimator)

  • year179
  • id46
  • date16
  • fips14
  • state14
  • age13
  • month13
  • gvkey11

Foundational works

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

Recent examples, straight from the code

One model per package, from the most recent papers — each one shows the design itself (why is given beside it).

Career guidance and investments in education: Experimental evidence from Cambodia Journal of Development Economics 2027 · an_cam2020_ipei_main.do:469 · pkg 158609 excluded instrument
ivreg2 `var1' (treated=tstatus)  $spec7_adm1  ,cluster(schoolid)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):
ivreg2 `var1' (treated=tstatus) female_adm age_adm grd_pre_ave_Total_cwinz grd_pre_ave_absence class_size District* SchoolCD ,cluster(schoolid)
Building infrastructure and cohesion through locally embedded institutions: Evidence from a field experiment in War-torn Eastern Congo Journal of Development Economics 2027 · programs_tables_iv.do:24 · pkg 158611 excluded instrument
ivreg2 `var' i.year_survey i.pro_id i.q8_projecttype ///
    $controls ($endog = $instrument), cluster(q4_cddid)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):
ivreg2 `var' i.year_survey i.pro_id i.q8_projecttype $controls (LATE_cdd_var = cdd_var_bi), cluster(q4_cddid)
Supporting learning in and out of school: Experimental evidence from India Journal of Development Economics 2027 · Table_10.do:103 · pkg 162035 excluded instrument
xi: ivreg2 `depvar' (LCSG_altFULL SG_alt LC_alt = LCSG SG LC) ///
    $extravars, cluster(calc_school_id) first
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):
xi: ivreg2 `depvar' (LCSG_altFULL SG_alt LC_alt = LCSG SG LC) baseline age_corrected_BL q21_child_gender_BL i.grade_BL, cluster(calc_school_id) first
Cross-Selling in Bank-Household Relationships: Mechanisms and Implications for Pricing Review of Financial Studies 2026 · 2_analysis.do:347 · pkg 48 excluded instrument
eststo: ivreghdfe futureborrower (existing_dep = old_mshare_deposit),  absorb(i.muniid#i.agebingroup#i.salaryquarter#i.educ) // IV
Institutional Corporate Bond Pricing Review of Financial Studies 2026 · ReplicationCodes_ICBP_Estimation_01_ss.do:107 · pkg 147 excluded instrument
eststo: ivreghdfe LNrweight (yield = IVme_alt6_95) LNtimetomat spread LNbv rating_num coupon_dec if type_new2==`i' [aw=aum_tot], a(date#fundid) clus(fundid) nocollin
Leaky Director Networks and Innovation Herding Review of Financial Studies 2026 · tables_1_to_7_figures_3_and_4.do:275 · pkg 172 excluded instrument
ivreghdfe  tsim4_wz     (oddensity4l1_wz =   c.z2#c.post2004  log_atl1 log_agel1    ) if year>=2000 & year<=2009 & tsim4_wz!=. & profitability_wz!=. & mkt_book_wz!=. & numpat2at_wz!=. & valpat2at_wz!=. & prodmktfluid_wz!=. , absorb(gvkey year ) cluster(sic_x_year gvkey) first
Collateral Effects: The Role of FinTech in Small Business Lending Review of Financial Studies 2026 · replication_package_codes_24_table_8a.do:315 · pkg 205 excluded instrument
eststo second: ivreghdfe lloan (p2pqtrcapturing=scoredeltapost) post volloanv $control_0  if deltaqdummy, cl(siren) a(qdate siren)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):
eststo second: ivreghdfe lloan (p2pqtrcapturing=scoredeltapost) post volloanv `"*_0 dum_*"' if deltaqdummy, cl(siren) a(qdate siren)
When Two Become One: Foreign Capital and Household Credit Expansion Review of Financial Studies 2026 · 4_Tables.do:539 · pkg 256 excluded instrument
xtivreg2 Fd3y (LD3_HH_RoTW_RD_GDP=LD3supply_GDP) LD3_HH_HH_RD_GDP LD3_HH_GG_RD_GDP LD3_B_L_NonFiInLoans_GDP LD3_CA_IFSorWEO_GDP ///
    l(1/3).d.lrgdp,  fe cluster(id) first
Beliefs and Portfolios: Causal Evidence Review of Financial Studies 2026 · FigureA7plusStockImpute.do:248 · pkg 276 excluded instrument
eststo: xi: ivregress 2sls risky_share_w1 (stockexp_post_avg_w1 = ib(6).drandom3) if (y_hat_wave1>=0.5), robust
The Broader Role of Venture Capital Due Diligence Review of Financial Studies 2026 · MainResults.do:92 · pkg 279 excluded instrument
eststo: ivreghdfe `v' (proceed = DAP)   lnamount2raise lage ltam ltsm  , a( locationregion) robust
Who Clears the Market When Passive Investors Trade? Review of Financial Studies 2026 · code_analysis_5_iv_baseline.do:126 · pkg 286 excluded instrument
ivreghdfe pchdadjshrout (pchdadjshrpass=ivshockadd ivshockflow),cluster(permno yq) a($fe) first savefirst
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):
ivreghdfe pchdadjshrout (pchdadjshrpass=ivshockadd ivshockflow),cluster(permno yq) a(yq#ff49) first savefirst
The Product Market Effects of Index Inclusion Review of Financial Studies 2026 · 02_figures.do:299 · pkg 292 excluded instrument
eststo: ivreghdfe d_price_ln_t_tp1 (d_qix = r_1_to_2 r_2_to_1) $running_3 $controls if share_product_module==`i', a(year#prod_cat year#industry) clus(firm) nocollin noid
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):
eststo: ivreghdfe d_price_ln_t_tp1 (d_qix = r_1_to_2 r_2_to_1) d_total_mv_ln d_total_mv_ln_sq d_total_mv_ln_cu d_ff_rus band band_d02 if share_product_module==`i', a(year#prod_cat year#industry) clus(firm) nocollin noid