Difference-in-differences
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: a DiD estimator (csdid, did_imputation, ...), a treatment × post interaction, a regressor whose name is one (treat_post, CaptiveXAfter, did), or a treatment / post indicator under two-way fixed effects.
- 479 packages declare the design in code; 262 are in it by their estimator (a package can be both).
Adoption over time — the dedicated estimator
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 498 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.
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 498 packages in the design, 449 have a model that shows the design itself, and 429 of those have a readable outcome (11,572 models; for 159 packages some outcome is read only through a loop's expansion). Shares are of those 429 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 — 70 of 80 packages have a readable outcome
-
employment / labour supply14% · 10written as
asinh_employees,chg_empl,emp_all_r,emp_fed_r,emp_g_w14 examples in the code
- Do Corporations Retain Too Much Cash? Evidence from a Natural Experiment
Review of Financial Studies 2023 · pkg 136
KKK_figures_tables_replication.do:533 ·
no_emplreghdfe no_empl i.treated##i.after, absorb(i.firmid i.year) vce(cluster groupid)
- The Impact of Carcinogenic Risk Exposure on Housing Values: Estimates from Chemical Reclas
Review of Financial Studies 2026 · pkg 278
eststo: reghdfe lnemp treated post post_treated if inrange(_t_bc,-`window',`window'), absorb($fe) vce(clus $clus)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):eststo: reghdfe lnemp treated post post_treated if inrange(_t_bc,-`window',`window'), absorb(plantid statecode#_t_bc naics#_t_bc) vce(clus plantid)
- Energy Transitions and Household Finance: Evidence from U.S. Coal Mining
Review of Corporate Finance Studies 2023 · pkg 7279
reghdfe `outcome'_r treat_post , vce(cluster state) absorb(i.fips i.year)
- Pirates without borders: The propagation of cyberattacks through firms’ supply chains
Journal of Financial Economics 2023 · pkg 14174
reghdfe `Y' post_`X' , absorb(firm_id peer_group_sic11#year) cluster(country sic_2digit)
- Do Corporations Retain Too Much Cash? Evidence from a Natural Experiment
Review of Financial Studies 2023 · pkg 136
-
credit / lending / default11% · 8written as
haircut,id_credit_banking_hist_issues,lcredit_commw,loan_rate_new,loan_secured4 examples in the code
- Macroprudential Policy, Mortgage Cycles, and Distributional Effects: Evidence from the Uni
Review of Financial Studies 2024 · pkg 128
code_Table_9.do:13 ·
log_loan_valeststo r`regnum': reghdfe log_loan_val interaction_post_share post demeaned_share_treated if time<=225 & time != 218 & low_income == 1, absorb(i.lacode_float i.time) vce(cluster lacode_float_3)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):eststo r1: reghdfe log_loan_val interaction_post_share post demeaned_share_treated if time<=225 & time != 218 & low_income == 1, absorb(i.lacode_float i.time) vce(cluster lacode_float_3)
- Market Discipline in the Direct Lending Space
Review of Financial Studies 2024 · pkg 210
Submission_Code_table13.do:6 ·
loan_rate_newreghdfe loan_rate_new i.ind_post##i.ind_treated_company c.company_instr_time_fe##i.ind_treated_company c.lag_assets_total_ln##i.ind_treated_company c.company_all_num##i.ind_treated_company c.lag_int_i …
- Gender Diversity in Bank Boardrooms and Green Lending: Evidence from Euro Area Credit Regi
Review of Corporate Finance Studies 2025 · pkg 7326
6_Main econometric analysis.do:169 ·
lcredit_commwreghdfe lcredit_commw i.treated_IT##i.post_IT##c.scope_123_rew_1000 if year_incptn<2020 , absorb(ILS3##year_incptn ID_bank##year_incptn) vce(cluster ID_bank)
- Venture Capital and Startup Agglomeration
The Journal of Finance 2025 · pkg 15592
Replication Code-20230343/produce_all_IA_tables.do:297 ·
log_loans_realestate(loop-expanded: y=log_loans_realestate)quiet eststo: reghdfe `y' cont_treatXpost if $SAMPLE, absorb(state_code year) vce(cluster state_code)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):quiet eststo: reghdfe `y' cont_treatXpost if ( year>=2010 & year<=2018 & num_funds_PreVol ~=0 ), absorb(state_code year) vce(cluster state_code)
- Macroprudential Policy, Mortgage Cycles, and Distributional Effects: Evidence from the Uni
Review of Financial Studies 2024 · pkg 128
-
profitability (ROA, ROE, margins, earnings)11% · 8written as
ROA,crypto_debit_amt,lnmargin,margin,mu_ROA4 examples in the code
- Real Effects of Centralized Markets: Evidence from Steel Futures
Review of Financial Studies 2025 · pkg 27
stata-code.do:353 ·
profit_atweststo: reghdfe `outcome' `treatment' , a(gvkey_introduction naics3#date_introduction) `cluster'
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):eststo: reghdfe profit_atw post_treated_f , a(gvkey_introduction naics3#date_introduction) cluster(gvkey)
- ESG Shocks in Global Supply Chains
Review of Financial Studies 2026 · pkg 266
eststo: reghdfe lnmargin treat_post_cut treat_post_nocut post if year~=event_year ,ab(firm_product cut#year case) cl(case#firm_product)
- Opioid Crisis and Real Estate Prices
Journal of Financial and Quantitative Analysis 2026 · pkg 14125
ReplicationCodeImputed/Stata/[S] SummaryStatisticsDiD.do:11 ·
prescriptionrate_pm8_rreghdfe prescriptionrate_pm8_r post l_maleratio l_whiteratio l_blackratio l_iaratio l_hispanicratio l_age20t64ratio l_age65pratio l_miginflowratio l_povertyratio l_unemploymnentrate l_laborpartrate l_ …
- Venture Capital and Startup Agglomeration
The Journal of Finance 2025 · pkg 15592
quiet eststo: reghdfe `y' cont_treatXpost if $SAMPLE, absorb(state_code year) vce(cluster state_code)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):quiet eststo: reghdfe `y' cont_treatXpost if ( year>=2010 & year<=2018 & num_funds_PreVol ~=0 ), absorb(state_code year) vce(cluster state_code)
- Real Effects of Centralized Markets: Evidence from Steel Futures
Review of Financial Studies 2025 · pkg 27
-
investment / capex / R&D10% · 7written as
bdc_investment,inv,inv_raise,invest,lavg_rad_mean_rd4 examples in the code
- Do Corporations Retain Too Much Cash? Evidence from a Natural Experiment
Review of Financial Studies 2023 · pkg 136
reghdfe inv i.treated##i.after, absorb(i.firmid i.year) vce(cluster groupid)
- Pension Fund Equity Investment and Firm Productivity
Journal of Financial and Quantitative Analysis 2026 · pkg 14136
eventstudyinteract `o' _I* $cntrl, absorb(i.cvr i.industry_year) cohort(cohort) control_cohort(controlgroup) vce(cluster cvr)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):eventstudyinteract `o' _I* age kintense, absorb(i.cvr i.industry_year) cohort(cohort) control_cohort(controlgroup) vce(cluster cvr)
- Employment Under Marijuana
Journal of Financial and Quantitative Analysis 2026 · pkg 46734
eststo full_`var': did_imputation w_`var' GlobalCompanyKey DataYearFiscal treat_year `sample', /// controls(`controls') tol(0.001) maxit(1000) autosample avgeffectsby(State) minn(0)As we read it — macros filled in / loop expanded (an interpretation, not the file's text):eststo full_`var': did_imputation w_`var' GlobalCompanyKey DataYearFiscal treat_year if drop_size==0 & Employees<0.5 & Employees!=0 & drop_sample==0 & rtw!=. & tax_free2!=. & labor_free2!=. & tobin_q1 …
- Direct lenders in the U.S. middle market
Journal of Financial Economics 2024 · pkg 113347
reghdfe `y' i.ind_post##i.ind_treated es_gr_lag gdp_gr_lag job_gains_lag job_losses_lag estab_middle_market_lag banks_num_office_per_estab_lag hhi_deposits_c_lag if county_set == 1, vce(robust) absorb …
- Do Corporations Retain Too Much Cash? Evidence from a Natural Experiment
Review of Financial Studies 2023 · pkg 136
-
prices / inflation / rents10% · 7written as
Dispersion_prc1,Dispersion_prc7,Dispersion_prc_range1,Dispersion_prc_range7,cv_price4 examples in the code
- Real Effects of Centralized Markets: Evidence from Steel Futures
Review of Financial Studies 2025 · pkg 27
stata-code.do:172 ·
sd_priceeststo: reghdfe sd_price post_treated , a(product_introduction date_introduction) cl(date)
- ESG Shocks in Global Supply Chains
Review of Financial Studies 2026 · pkg 266
eststo: reghdfe lnprice_ treat_post_cut treat_post_nocut post if year~=event_year ,ab(firm_product cut#year case) cl(case#firm_product)
- Pension Fund Equity Investment and Firm Productivity
Journal of Financial and Quantitative Analysis 2026 · pkg 14136
eventstudyinteract `o' _I* $cntrl, absorb(i.cvr i.industry_year) cohort(cohort) control_cohort(controlgroup) vce(cluster cvr)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):eventstudyinteract `o' _I* age kintense, absorb(i.cvr i.industry_year) cohort(cohort) control_cohort(controlgroup) vce(cluster cvr)
- The Capitalization of Consumer Financing into Durable Goods Prices
The Journal of Finance 2021 · pkg 15769
reghdfe lnprice c.treat##c.post, absorb(ymmtxym cz)
- Real Effects of Centralized Markets: Evidence from Steel Futures
Review of Financial Studies 2025 · pkg 27
-
stock returns / abnormal returns10% · 7written as
CAR,CAR10,CAR30,CAR50,car_3f4 examples in the code
- Real Effects of Centralized Markets: Evidence from Steel Futures
Review of Financial Studies 2025 · pkg 27
stata-code.do:406 ·
car_meststo: reghdfe car_m treated , a(permno date) cluster(permno)
- Do Corporations Retain Too Much Cash? Evidence from a Natural Experiment
Review of Financial Studies 2023 · pkg 136
KKK_figures_tables_replication.do:154 ·
excess_retreg excess_ret c.dCash##c.treated##c.after dEarn c.dEarn#c.treated c.dEarn#c.after c.dEarn#c.treated#c.after dNA c.dNA#c.treated c.dNA#c.after c.dNA#c.treated#c.after dRD c.dRD#c.treated c.dRD#c.after …
- Returns to Scale from Labor Specialization: Evidence from Asset Management Mergers
Review of Corporate Finance Studies 2024 · pkg 7291
reghdfe `var' c.treat##c.post##c.largedelta $controls, a($basefe) cluster($cluster)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):reghdfe `var' c.treat##c.post##c.largedelta firmsize fundsize expenses volatility pastreturn, a(deal_id#pair#fundid deal_id#pair#time) cluster(deal_id time)
- J’Accuse! Antisemitism and financial markets in the time of the Dreyfus Affair
Journal of Financial Economics 2024 · pkg 14199
Replication/do/analysis_sdid.do:381 ·
return_ieststo: reghdfe return_i treat1 treat2 if m_matched==1, a(i.firmn i.m_strata##i.daten i.sectorn##i.yearmonth) cluster(firmperiod)
- Real Effects of Centralized Markets: Evidence from Steel Futures
Review of Financial Studies 2025 · pkg 27
-
leverage / debt9% · 6written as
CG_LEV_A_w,debt_balance,lev_more5Y,lt_book_leverage,lt_market_leverage4 examples in the code
- The Capitalization of Consumer Financing into Durable Goods Prices
The Journal of Finance 2021 · pkg 15769
ivreg2 ltv c.post##c.treat dti origfico if tag==1, cluster(loanym cz)
- Climate Adaptation Risk and Capital Structure: Evidence From State Climate Adaptation Plan
Financial Management 2025 · pkg 39349
eststo: quietly reghdfe `y' $key_indep $control , $clustervar1 absorb(sic4 fyear stcode )
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):eststo: quietly reghdfe `y' inter treated plan_post ln_assets lnage mtob roa tangibility dvdummy modified_altmanz rd1 gsp_growth blue , vce(cluster stcode) absorb(sic4 fyear stcode )
- Resilience in collective bargaining
Journal of Financial Economics 2025 · pkg 125683
ReplicationPackage/StataCode/FigureDiDRwlParallelTrendsSunAbraham.do:66 ·
lev_more5Y(loop-expanded: y=lev_more5Y)eventstudyinteract `y' pre_4 pre_3 pre_2 post_0 post_1 post_2 post_3 post_4 , cohort(first_rwl) control_cohort(never_rwl) absorb(i.gvkey i.year_ind_fe) vce(cluster state_code)
- Intellectual Property Rights and Debt Financing
Review of Financial Studies 2023 · pkg 129603
Code_submission_main_code_submission.do:33 ·
totdebt_ateststo: qui reghdfe totdebt_at i.treat##i.post, absorb(gvkey fyear) vce(cluster state)
- The Capitalization of Consumer Financing into Durable Goods Prices
The Journal of Finance 2021 · pkg 15769
-
sales / output / quantities / productivity9% · 6written as
Revenue_cpi,lnsales,realgdp_growth,rev,rev_response_coeff4 examples in the code
- The Impact of Carcinogenic Risk Exposure on Housing Values: Estimates from Chemical Reclas
Review of Financial Studies 2026 · pkg 278
eststo: reghdfe lnsales treated post post_treated if inrange(_t_bc,-`window',`window'), absorb($fe) vce(clus $clus)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):eststo: reghdfe lnsales treated post post_treated if inrange(_t_bc,-`window',`window'), absorb(plantid statecode#_t_bc naics#_t_bc) vce(clus plantid)
- Human Capital Reallocation across Firms: Evidence from Idiosyncratic Shocks
Review of Corporate Finance Studies 2025 · pkg 7288
Gilje_Taillard_Zeng_Replication_Financial_Analysis.do:13 ·
Revenue_cpiareg Revenue_cpi pre3##Treated pre2##Treated pre1##Treated post1##Treated post2##Treated post3##Treated i.idRelegation, absorb(RelegationEvent) robust
- Venture Capital and Startup Agglomeration
The Journal of Finance 2025 · pkg 15592
Replication Code-20230343/produce_all_IA_tables.do:409 ·
realgdp_growth(loop-expanded: y=realgdp_growth)quiet eststo: reghdfe `y' cont_treatXpost if $SAMPLE, absorb(state_code year) vce(cluster state_code)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):quiet eststo: reghdfe `y' cont_treatXpost if ( year>=2010 & year<=2018 & num_funds_PreVol ~=0 ), absorb(state_code year) vce(cluster state_code)
- Brokers and Order Flow Leakage: Evidence from Fire Sales
The Journal of Finance 2019 · pkg 15708
Table 5.do:35 ·
revreghdfe rev best_X_post best post, $FE $CL
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):reghdfe rev best_X_post best post, absorb( permno manager#seq_id ym ) vce ( cluster ( manager#seq_id ) )
- The Impact of Carcinogenic Risk Exposure on Housing Values: Estimates from Chemical Reclas
Review of Financial Studies 2026 · pkg 278
Economics — 341 of 393 packages have a readable outcome
-
employment / labour supply16% · 54written as
employed(10),emp(4),work(3),lemp(2),ln_employees(2)4 examples in the code
- On the Effects of the Availability of Means of Payments: The Case of Uber
Quarterly Journal of Economics 2022 · pkg 7434
Code_StepA1_-_Dynamic_Effects.do:356 ·
ln_driver_hoursdid_multiplegt ln_driver_hours city_id time EVENT, robust_dynamic dynamic(70) placebo(35) longdiff_placebo breps(10) seed(1) controls(e_rate inc_pc precipitation ln_tourism trend ) graphoptions( x …
- The Role of the Ask Gap in Gender Pay Inequality
Quarterly Journal of Economics 2024 · pkg 7524
Replication_Package_Code_Main_Tables.do:1175 ·
first_offer_hoursreg first_offer_hours i.female after i.female_after $expcontrols, vce(cluster sid)
- Trading Nontradables: The Implications of Europe’s Job-Posting Policy
Quarterly Journal of Economics 2024 · pkg 7539
Replication_package_code_Fig6.do:403 ·
logempdid_imputation logemp id year event_d if event_d>2013, autosample pretrends(4) horizon(0 1 2 3 4 )
- Manufacturing Revolutions: Industrial Policy and Industrialization in South Korea
Quarterly Journal of Economics 2025 · pkg 7606
replicationpackage_code_0_analysis_1_main_scripts_3b_run_doublerobust_analysis.do:201 ·
l_workers(loop-expanded: variable=l_workers)csdid `variable' `controlset', /// time(year) ivar(id) gvar(gvar) /// method(reg) agg(event) replaceAs we read it — macros filled in / loop expanded (an interpretation, not the file's text):csdid `variable' l_costs_0 l_avg_size_0 l_avg_wages_0 l_y_n_0, time(year) ivar(id) gvar(gvar) method(reg) agg(event) replace
- On the Effects of the Availability of Means of Payments: The Case of Uber
Quarterly Journal of Economics 2022 · pkg 7434
-
education / test scores8% · 29written as
math(2),Education,GPA_std,SDall_fe_prin_attendance,attendance4 examples in the code
- Why Doesn’t the United States Have National Health Insurance? The Political Role of the Am
Quarterly Journal of Economics 2026 · pkg 7432
QJE_REP_CODE/1code/c_components_coef_rep.do:30 ·
share_enrollreghdfe share_enroll $design_controls_state c.std_add_exp post std_add_exp_post, a(state_fips yr) cluster(state_fips)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):reghdfe share_enroll personal_income union_st c.std_add_exp post std_add_exp_post, a(state_fips yr) cluster(state_fips)
- The Market for High-Quality Medicine: Retail Chain Entry and Drug Quality in India
Review of Economics and Statistics 2019 · pkg 13332
reg `var' post_trt post trt if round<3, cl(mkt_id)
- Do Sanitary Pads Improve Girls' Educational Outcomes?
Review of Economics and Statistics 2024 · pkg 13524
did_multiplegt chg_enrolment`i' school_gender year t_machine_installation if balancedpanel`i'==1, cluster(schcd) breps(300) /// placebo(2) /// covariances jointtestplacebo /// trends_nonparam(blockcod …
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):did_multiplegt chg_enrolment`i' school_gender year t_machine_installation if balancedpanel`i'==1, cluster(schcd) breps(300) placebo(2) covariances jointtestplacebo trends_nonparam(blockcode) trends_li …
- Medical Worker Migration and Origin-Country Human Capital: Evidence from U.S. Visa Policy
Review of Economics and Statistics 2024 · pkg 13652
did_imputation `var' provcode year treatment if year>=1991&year<=2013, timecontrols(emp_f_2564_90 emp_m_2564_90 female_90 age_90 nurse_cen_pc90) cluster(provcode) allhorizons pretrends(9 );
- Why Doesn’t the United States Have National Health Insurance? The Political Role of the Am
Quarterly Journal of Economics 2026 · pkg 7432
-
health / mortality8% · 27written as
bmi(2),injuries(2),N_Death_high,N_Death_high_pp,N_Death_low4 examples in the code
- Ambulance Taxis: The Impact of Regulation and Litigation on Health-Care Fraud
Journal of Political Economy 2025 · pkg 7764
eststo est1: reghdfe `var' ib99.post_together $pat_controls $fac_controls, a(t newprovusrd dist_code) vce(cluster dist_code)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):eststo est1: reghdfe `var' ib99.post_together inc_diabetes inc_hyper i.bmi_bin i.gfr_bin male nhwhite black hisp asian rother c.pat_age c.pat_age2 c.pat_age3 c.dial_tenure c.dial_tenur …
- Presidential Address: Investing in Children to Address the Child Mental Health Crisis
American Economic Review 2025 · pkg 11706
Replication/Scripts/Figure 6/figure6.do:113 ·
cruderate_suicide(loop-expanded: y=cruderate_suicide)csdid `y' `controls', ivar(panel_group) time(year) gvar(event_year) long2 agag(event)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):csdid `y' found_1 red_flag_laws found_5, ivar(panel_group) time(year) gvar(event_year) long2 agag(event)
- Can Educational Outreach Improve Experts' Decision Making? Evidence from a National Opioid
Review of Economics and Statistics 2025 · pkg 12995
6_Main Exhibits.R:422 ·
N_Death_ppN_Death_pp <- aggte(att_gt(yname="N_Death_pp", tname="NormalizedTime", idname="TeamSID", gname="FirstADS", data=panel, weightsname="PanelSize", base_period="varying"), type="dynamic", min_e=-8, max_e= …
- ’Til Dowry Do Us Part: Bargaining and Violence in Indian Families
Review of Economics and Statistics 2026 · pkg 13443
RESTAT_REPLICATION_SUBMIT_Main_Paper_codes_Standard_Errors_Table_A14_Table1_Table2.do:313 ·
injuries(loop-expanded: y=injuries)did_imputation `y' id3 yy_1marr E1 [aw= v005] , fe(hindu1 yearb yy_1marr state) controls(scstbc rural) cluster($cluster ) autosample
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):did_imputation `y' id3 yy_1marr E1 [aw= v005] , fe(hindu1 yearb yy_1marr state) controls(scstbc rural) cluster(state ) autosample
- Ambulance Taxis: The Impact of Regulation and Litigation on Health-Care Fraud
Journal of Political Economy 2025 · pkg 7764
-
demographics (often balance / covariate checks)7% · 25written as
age(5),female(2),male(2),married(2),Female4 examples in the code
- Teaching Entrepreneurship: Impact Of Business Training On Microfinance Clients And Institu
Review of Economics and Statistics 2011 · pkg 13455
reg `var' post treatment dd sucurs if miss_`var'==1 & cofficer_lb~=.
- Warding off Development: Local Control, Housing Supply, and NIMBYs
Review of Economics and Statistics 2024 · pkg 13905
Table_2_-_Main_DD.do:65 ·
pc_singlecsdid pc_single statefips pop80 pct_white80 pct_owned80 median_hh_income80 /// , ivar(id) time(year) gvar(treatment_year) cluster(statefips) - Bringing Them In or Pushing Them Out? The Labor Market Effects of Pro-Cyclical Unemploymen
Review of Economics and Statistics 2025 · pkg 14017
reg `outcome' i.treat##i.after $samplerest & `durvar'==`dur' `Rest', r
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):reg `outcome' i.treat##i.after if (male!=. & highschool!=. & urban!=. & var_urate_prov_qstart!=. & `durvar'==`dur' `Rest', r
- Managers’ Productivity and Recruitment in the Public Sector
American Economic Journal: Economic Policy 2024 · pkg 17257
reghdfe `var' PostChangePpal_ADP PostChangePpal if sample==1, a(year rbd) vce(cluster rbd)
- Teaching Entrepreneurship: Impact Of Business Training On Microfinance Clients And Institu
Review of Economics and Statistics 2011 · pkg 13455
-
income / consumption / wealth / inequality7% · 24written as
log_consumption(2),BTF_pc_expenditure,LNINC,any_income,father_transfers4 examples in the code
- The Impact of Children's Health Shocks on Parents' Labor Earnings and Mental Health
Review of Economics and Statistics 2024 · pkg 13403
Finland_code_4.analysis.do:3190 ·
incomeeventstudyinteract income $event_dummies if year_calendar < 2014, cohort(yearinp) /// control_cohort(last_cohort) /// absorb(i.mother_id i.year_calendar) vce(cluster mother_id)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):eventstudyinteract income i_time_even_2 i_time_even_3 i_time_even_5 i_time_even_6 i_time_even_7 i_time_even_8 i_time_even_9 if year_calendar < 2014, cohort(yearinp) control_cohort(last_cohort) absorb( …
- Migration and resilience during a global crisis
European Economic Review 2023 · pkg 15273
DoFiles_G2G_Main_Analysis.do:44 ·
usd_win_incareg usd_win_inc lottery_post post lottery i.round, /// absorb(upazila_Clean) cluster(union_Clean) - Financial Technology Adoption: Network Externalities of Cashless Payments in Mexico
American Economic Review 2024 · pkg 17252
did_multiplegt log_spending_`storetype'_tot localidad_factor year D_jt, /// cluster(localidad_factor) breps(`N_reps')As we read it — macros filled in / loop expanded (an interpretation, not the file's text):did_multiplegt log_spending_`storetype'_tot localidad_factor year D_jt, cluster(localidad_factor) breps(2000)
- Consumer Credit and the Incidence of Tariffs: Evidence from the Auto Industry
American Economic Review 2026 · pkg 17449
Code/02_Analysis/01_Main_Results.do:338 ·
ln_incomeeststo Table5_1: reghdfe ln_income captive after CaptiveXAfter, absorb(yr_qtr#make_model#New yr_qtr#grp_state lender) cluster(lender)
- The Impact of Children's Health Shocks on Parents' Labor Earnings and Mental Health
Review of Economics and Statistics 2024 · pkg 13403
-
wages / earnings7% · 24written as
wage_bill(2),IHS_mean_wage,IHS_wage_bill,LNEARN,any_wages4 examples in the code
- The Role of the Ask Gap in Gender Pay Inequality
Quarterly Journal of Economics 2024 · pkg 7524
Replication_Package_Code_Appendix_Output.do:905 ·
logs_salary_predreg logs_salary_pred i.female after i.female_after , r
- Trading Nontradables: The Implications of Europe’s Job-Posting Policy
Quarterly Journal of Economics 2024 · pkg 7539
did_multiplegt logwage group ano treati, placebo(4) breps(40) dynamic(4) cluster(cluster`y')
- The Effect of Franchise No-Poaching Restrictions on Worker Earnings
Review of Economics and Statistics 2024 · pkg 14010
capture noisily did_imputation $dep_var $unique_unit_id $calendar_period $unit_treat_date1 , fe($fixed_effects) $other_specs_did nose
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):capture noisily did_imputation log_salary_r employer_number yq settlement_date_yq_aod , fe(yq##cz_code_2000 yq##soc_4d soc_4d##employer_number) autosample pretrends(5) maxit(10000) nose
- Strategies and consequences of local fiscal consolidation: Evidence from Germany
Journal of Urban Economics 2025 · pkg 14967
eststo borusyak_`yvar': did_imputation `yvar' muni2010 year year_event, /// autosample fe(ror2010##year muni2010) /// horizons(0/`postmax') pretrends(`pretrends') / …As we read it — macros filled in / loop expanded (an interpretation, not the file's text):eststo borusyak_`yvar': did_imputation `yvar' muni2010 year year_event, autosample fe(ror2010##year muni2010) horizons(0/r(max) - r(min) - 1) pretrends(r(max) - r(min) + 1) tol(.1) minn(0) cluster(dis …
- The Role of the Ask Gap in Gender Pay Inequality
Quarterly Journal of Economics 2024 · pkg 7524
-
sales / output / quantities / productivity6% · 22written as
log_sales(2),gdp_growth,gdp_pc,hold_prod_asset,ihs_rev4 examples in the code
- Manufacturing Revolutions: Industrial Policy and Industrialization in South Korea
Quarterly Journal of Economics 2025 · pkg 7606
replicationpackage_code_0_analysis_3_suppappendix_scripts_SUPP_APP_B_run_micro_tfp_dynamic_analysis.do:78 ·
tfp_w(loop-expanded: variable=tfp_w)reghdfe `variable' i.hci##ib(1980).year , /// absorb( id year ) /// vce( cluster ksic_id id ) - Policy Experimentation in China: The Political Economy of Policy Learning
Journal of Political Economy 2025 · pkg 7717
eventstudyinteract gdp_pc Lag_D3 Lag_D2 Lag_D1 Lag_D0 Lead_D2 Lead_D3 Lead_D4 if reform_year_all<2007 | reform_year_all==., absorb(i.year i.county_id i.year##i.prov_id) cohort(first_reform) control_c …
- Ambulance Taxis: The Impact of Regulation and Litigation on Health-Care Fraud
Journal of Political Economy 2025 · pkg 7764
replication_code_3_15_firmlevel_analysis.do:72 ·
log_tot_reveststo: reghdfe log_tot_rev post_treat size2_inter size3_inter size4_inter if group1==1, a(i.year##i.size_oth i.state_code##i.size_oth) vce(cluster state)
- Banking Networks and Economic Growth: From Idiosyncratic Shocks to Aggregate Fluctuations
American Economic Journal: Macroeconomics 2026 · pkg 11744
5.-PROGRAM/2. Main_Tables.do:72 ·
w_g_gdpqui eststo m3: reghdfe w_g_gdp post_ind_tau_1 ind_tau_1 post, a(region_gdp#year region_tau#year) cl(state_1 state_2) nocons
- Manufacturing Revolutions: Industrial Policy and Industrialization in South Korea
Quarterly Journal of Economics 2025 · pkg 7606
-
prices / inflation / rents6% · 20written as
lprice(3),price(2),price_res1(2),price_res2(2),get_vac_rent4 examples in the code
- On the Effects of the Availability of Means of Payments: The Case of Uber
Quarterly Journal of Economics 2022 · pkg 7434
did_multiplegt price city_id time EVENT, robust_dynamic dynamic(70) placebo(35) longdiff_placebo breps(10) seed(1) controls(e_rate inc_pc precipitation ln_tourism trend ) graphoptions( xlabel(-30 …
- Manufacturing Revolutions: Industrial Policy and Industrialization in South Korea
Quarterly Journal of Economics 2025 · pkg 7606
replicationpackage_code_0_analysis_1_main_scripts_3b_run_doublerobust_analysis.do:201 ·
l_ppi(loop-expanded: variable=l_ppi)csdid `variable' `controlset', /// time(year) ivar(id) gvar(gvar) /// method(reg) agg(event) replaceAs we read it — macros filled in / loop expanded (an interpretation, not the file's text):csdid `variable' l_costs_0 l_avg_size_0 l_avg_wages_0 l_y_n_0, time(year) ivar(id) gvar(gvar) method(reg) agg(event) replace
- Urban Transit Infrastructure and Inequality
Review of Economics and Statistics 2026 · pkg 13689
Replication_package_code_3_eventstudy.do:89 ·
log_priceeststo: areg log_price treat##post if quarter<=20 & quarter>-10, r absorb(flat_id)
- Mask wars: Sourcing a critical medical product from China in times of COVID-19
Journal of International Economics 2025 · pkg 14394
reghdfe lprice ib0.post##ib0.treat, absorb(ccode#province#yearmonth ccode#province#hs8) vce(cluster ccode#province#hs8)
- On the Effects of the Availability of Means of Payments: The Case of Uber
Quarterly Journal of Economics 2022 · pkg 7434
Outcomes that are taxonomy measures (all fields: the package computes the measure and estimates it as the outcome)
- Book Leverage 1 package · 4 models
1 example in the code
- Resilience in collective bargaining
Journal of Financial Economics 2025 · pkg 125683
ReplicationPackage/StataCode/FigureDiDRwlParallelTrendsSunAbraham.do:66 ·
lev(loop-expanded: y=lev)eventstudyinteract `y' pre_4 pre_3 pre_2 post_0 post_1 post_2 post_3 post_4 , cohort(first_rwl) control_cohort(never_rwl) absorb(i.gvkey i.year_ind_fe) vce(cluster state_code)
- Resilience in collective bargaining
Journal of Financial Economics 2025 · pkg 125683
- Capital Expenditure 1 package · 5 models
1 example in the code
- Burn now or never? Climate policy exposure and investment of fossil fuel firms
Journal of International Economics 2026 · pkg 96970
8_Replication package/2_tasks/Table 10- Imputation Estimation Results.do:58 ·
firm_investment_ratioqui eststo m2: did_imputation firm_investment_ratio gvkey year Ei, /// fe(gvkey year) cluster(gvkey) autosample maxit(400)
- Burn now or never? Climate policy exposure and investment of fossil fuel firms
Journal of International Economics 2026 · pkg 96970
- Cash Effective Tax Rate 1 package · 10 models
1 example in the code
- Reciprocity in Corporate Tax Compliance—Evidence from Ozone Pollution
Journal of Accounting Research 2023 · pkg 12662
CFHLL_stata.do:380 ·
cash_etr3qui 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 …
- Reciprocity in Corporate Tax Compliance—Evidence from Ozone Pollution
Journal of Accounting Research 2023 · pkg 12662
- Operating Margin 1 package · 36 models
1 example in the code
- Board connections, firm profitability, and product market actions
Journal of Financial Economics 2026 · pkg 114094
ProfitMarginTest/A06_Merger_DID.do:276 ·
oibdptosalereghdfe oibdptosale treated post treatedXpost, absorb($fe) vce(cluster companyid)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):reghdfe oibdptosale treated post treatedXpost, absorb(i.ff48##i.year i.timeseriesid) vce(cluster companyid)
- Board connections, firm profitability, and product market actions
Journal of Financial Economics 2026 · pkg 114094
- R&D Intensity 1 package · 1 models
1 example in the code
- Propagation And Amplification Of Local Productivity Spillovers
Econometrica 2024 · pkg 18640
reghdfe rd mdp post [weight=sempweight], absorb(firmid firmsic3#year case) cluster(firmid year)
- Propagation And Amplification Of Local Productivity Spillovers
Econometrica 2024 · pkg 18640
- Restatement Indicator 1 package · 5 models
1 example in the code
- Fraud Power Laws
Journal of Accounting Research 2024 · pkg 12683
GeoPeer_Step2_DIDAnalysis.do:99 ·
restate_corereghdfe restate_core c.treated##c.post , noa cluster(state1)
- Fraud Power Laws
Journal of Accounting Research 2024 · pkg 12683
- Return on Assets (ROA) 1 package · 36 models
1 example in the code
- Board connections, firm profitability, and product market actions
Journal of Financial Economics 2026 · pkg 114094
reghdfe roa treated post treatedXpost, absorb($fe) vce(cluster companyid)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):reghdfe roa treated post treatedXpost, absorb(i.ff48##i.year i.timeseriesid) vce(cluster companyid)
- Board connections, firm profitability, and product market actions
Journal of Financial Economics 2026 · pkg 114094
Commonest outcome names no group reads (all fields, packages): coverage (3), other (3), resid (3), total (3), alcohol (2), count (2), diff (2), disab (2), drugs (2), light (2), lny (2), logposted (2).
Commands (of the 262 packages running the dedicated estimator)
did_imputation91eventstudyinteract86csdid75did_multiplegt71att_gt26xtdidregress5drdid4did2s1
Inference (of the 262 packages running the dedicated estimator)
cluster187default117robust4wild_bootstrap1
Clustering variables (of the 262 packages running the dedicated estimator)
id10i9fips7statefips7state6statefip5cityid3state_fips3
Absorbed fixed effects (of the 262 packages running the dedicated estimator)
i.year43id8t8i7date3i.gvkey3i.qdate3i.statefip3
Foundational works
What the papers whose code runs this estimator cite most (share of those papers citing each).
- Difference-in-Differences with multiple time periods — Brantly Callaway; Pedro H.C. Sant’Anna (2021), Journal of Econometrics109 · 42%
- Estimating dynamic treatment effects in event studies with heterogeneous treatment effects — Liyang Sun; Sarah Abraham (2021), Journal of Econometrics95 · 36%
- Difference-in-differences with variation in treatment timing — Andrew Goodman-Bacon (2021), Journal of Econometrics90 · 34%
- Revisiting Event-Study Designs: Robust and Efficient Estimation — Kirill Borusyak; Xavier Jaravel; Jann Spiess (2024), Review of Economic Studies88 · 34%
- Two-Way Fixed Effects Estimators with Heterogeneous Treatment Effects — Clément de Chaisemartin; Xavier D’Haultfœuille (2020), American Economic Review85 · 33%
- The Effect of Minimum Wages on Low-Wage Jobs — Doruk Cengiz; Arindrajit Dubé; Attila Lindner; Ben Zipperer (2019), Quarterly Journal of Economics26 · 10%
- How much should we trust staggered difference-in-differences estimates? — Andrew C. Baker; David F. Larcker; Charles C.Y. Wang (2022), Journal of Financial Economics25 · 10%
- What’s trending in difference-in-differences? A synthesis of the recent econometrics literature — Jonathan Roth; Pedro H.C. Sant’Anna; Alyssa Bilinski; John Poe (2023), Journal of Econometrics24 · 9%
- A More Credible Approach to Parallel Trends — Ashesh Rambachan; Jonathan Roth (2023), Review of Economic Studies22 · 8%
- Difference-in-Differences Estimators of Intertemporal Treatment Effects — Clément de Chaisemartin; Xavier D'Haultfœuille (2026), Review of Economics and Statistics18 · 7%
- Pretest with Caution: Event-Study Estimates after Testing for Parallel Trends — Jonathan Roth (2022), American Economic Review: Insights15 · 6%
- Design-based analysis in Difference-In-Differences settings with staggered adoption — Susan Athey; Guido W. Imbens (2022), Journal of Econometrics13 · 5%
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).
did_imputation trade4 i t Ei , fe(pair indyear case) controls($x period_2 period_1 period0 period1 period2 period3) autosample cluster(casesupp) tol(0.1)
did_imputation trade4 i t Ei , fe(pair indyear case) controls(size mtb lev rd invest cash period_2 period_1 period0 period1 period2 period3) autosample cluster(casesupp) tol(0.1)
eststo: reghdfe lnemp treated post post_treated if inrange(_t_bc,-`window',`window'), absorb($fe) vce(clus $clus)
eststo: reghdfe lnemp treated post post_treated if inrange(_t_bc,-`window',`window'), absorb(plantid statecode#_t_bc naics#_t_bc) vce(clus plantid)
eventstudyinteract rgls scs_high_hhi scs_low_hhi , cohort(list_scs) control_cohort(never_treat) covariates(ubeta idvol logmv mb mlev fbias sgrw ixrgls) absorb(i.gvkey i.year) vce(cluster incorpn)
eststo: reghdfe lspread treat_post treat post , abs(ind_yr bank_yr msa) cluster(msa) keepsing
reghdfe share_enroll $design_controls_state c.std_add_exp post std_add_exp_post, a(state_fips yr) cluster(state_fips)
reghdfe share_enroll personal_income union_st c.std_add_exp post std_add_exp_post, a(state_fips yr) cluster(state_fips)
eventstudyinteract ash_f1allpat postchange, cohort(cohort) control_cohort(notmoretrust) ///
covariates(${firm} ${ceo} postchange) absorb(eventid year) vce(cluster ${cluster})eventstudyinteract ash_f1allpat postchange, cohort(cohort) control_cohort(notmoretrust) covariates(firmage firmage2 gender age age2 yrinco i.education postchange) absorb(eventid year) vce(cluster eventid)
csdid `v'1529 [weight=pop], time(cohort_f) gvar(xxx) cluster(kommun60_bf) agg(simple) notyet
did_imputation log_c_any st mdate treated if Sexual_Harassment_indicator==1 & mdate>=582, autosample cluster(st) fe(st mdate)
eventstudyinteract Y F*event L*event if arrested==1 & t!=219 , vce(cluster i) absorb(i t i.yob#c.t i.female#c.t i.idnac#c.t) cohort(ei) control_cohort(lastcohort)
qui eststo m3: reghdfe w_g_gdp post_ind_tau_1 ind_tau_1 post, a(region_gdp#year region_tau#year) cl(state_1 state_2) nocons
atts <- att_gt(
yname = "crude_rate_20_64",
tname = "year",
idname = "county_code",
gname = "treat_year",
xformla = as.formula(paste("~", paste(covs, collapse = "+"))),
data = data_cs,
panel = TRUE, …
ivreghdfe $y i.post i.post#i.treat (endogen2 = instrument3 instrument32 ins4) tp_female tp_child_b18_d tp_child_a18_d tp_child_missing tp_ln_inc $controls1 if inrange(ref_time,-1,0) & h_koen==1, absorb(s_pnr) cluster(s_pnr)
ivreghdfe h_psycho i.post i.post#i.treat (endogen2 = instrument3 instrument32 ins4) tp_female tp_child_b18_d tp_child_a18_d tp_child_missing tp_ln_inc i.year c.h_alder c.h_alder_2 if inrange(ref_time,-1,0) & h_koen==1, absorb(s_pnr) cluster(s_pnr)