← Methods

GMM

201
packages run it, of 7,459 whose models we parsed
200
papers
2,241
estimation commands

Adoption over time

2010: 2 of 34 packages (5.9%) 2010 2011: 7 of 77 packages (9.1%) 2012: 2 of 63 packages (3.2%) 2013: 7 of 107 packages (6.5%) 2014: 9 of 107 packages (8.4%) 2015: 6 of 156 packages (3.8%) 2015 2016: 5 of 105 packages (4.8%) 2017: 5 of 121 packages (4.1%) 2018: 2 of 151 packages (1.3%) 2019: 10 of 253 packages (4.0%) 2020: 11 of 246 packages (4.5%) 2020 2021: 5 of 392 packages (1.3%) 2022: 20 of 775 packages (2.6%) 2023: 24 of 909 packages (2.6%) 2024: 29 of 1,136 packages (2.6%) 2025: 24 of 1,322 packages (1.8%) 2025 2026: 33 of 1,459 packages (2.3%)

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.

Commands (of the 201 packages running the dedicated estimator)

  • gmm119
  • xtabond256
  • xtabond24
  • xtdpd9
  • pgmm2
  • xtdpdgmm2
  • ivgmm1

Inference (of the 201 packages running the dedicated estimator)

  • default95
  • robust75
  • cluster45
  • hac12
  • bootstrap4

Clustering variables (of the 201 packages running the dedicated estimator)

  • id6
  • ccode3
  • countrycode2
  • newid2
  • `vcec'1
  • characteristics_ptf1
  • city_pair1
  • cluster1

Absorbed fixed effects (of the 201 packages running the dedicated estimator)

  • month_ids1
  • product_ids1
  • store_ids1
  • year_ids1

Foundational works

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

Recent examples, straight from the code

Labor Market Competition and the Assimilation of Immigrants American Economic Review 2026 · 5_RB_Estimation_immigrants_gmm.do:618 · pkg 11739
gmm assim_gmm [pw=${weight}], depvar(depvar) skills(Gt_nat Gt_imm genskills residuals) regs(${regs}) demand(${demand}) hasderivatives parameters(${pars}) instruments(${reg_instr} ${dem_instr} ${sig_instr},noconstant) neq(1) twostep `initial'
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):
gmm assim_gmm [pw=weight_state], depvar(depvar) skills(Gt_nat Gt_imm genskills residuals) regs(cons `o_list' `yso_list' `e_list' `yse_list' `eab_list' `c_list' `ysc_list') demand(trend) hasderivatives parameters(s_cons s_Lat s_West s_Asia s_Oth s_LatXysm s_WestXysm s_AsiaXysm s_OthXysm s_LatXysm2 s_WestXysm2 s_AsiaXysm2 s_OthXysm2 s_LatXysm3 s_WestXysm3 s_AsiaXysm3 s_OthXysm3 s_HSG s_SC s_CG s_HSG
Physicians and the Production of Health: Returns to Health Care during the Mortality Transition Review of Economics and Statistics 2026 · analysis.do:202 · pkg 13347
gmm                                                           ///
  (eq3: (_r`endvar' - {xb:_r`iv' _cons jahr_`ybegin'-jahr_1936})) ///
  (eq1: (_r`depvar' - (`xbeta')))                             ///
  (eq2: (_r`depvar' - (`xbeta'))*(_r`endvar' - {xb:})),       ///
  instruments(eq3: _r`iv'                                                     jahr_`ybegin'-jahr_1936) ///
  instruments(eq1: _r`endvar' `_raddvar0' `_raddvar1' `_raddvar2' `_raddvar3' jahr_`ybegin'-jahr_1936) ///
  instruments(eq2:                                                            jahr_`ybegin'-jahr_1936) ///
  winitial( …
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):
gmm (eq3: (_r`endvar' - {xb:_r`iv' _cons jahr_`2'-jahr_1936})) (eq1: (_r`depvar' - ({b1}*_r`endvar' `b2' `b3' `b4' `b5' + {bc}*(_r`endvar'-{xb:}) + {b0} + {y32}*jahr_1932 + {y33}*jahr_1933 + {y34}*jahr_1934 + {y35}*jahr_1935 + {y36}*jahr_1936))) (eq2: (_r`depvar' - ({b1}*_r`endvar' `b2' `b3' `b4' `b5' + {bc}*(_r`endvar'-{xb:}) + {b0} + {y32}*jahr_1932 + {y33}*jahr_1933 + {y34}*jahr_1934 + {y35}*ja
Investment Functions with q in the Presence of Unobserved Persistent Shocks Journal of Financial and Quantitative Analysis 2026 · All_Tables.do:224 · pkg 14131
eststo: gmm(d.inv-{b2}*d.l.TQ-{b3}*d.CF-{b4}*d.l.lnK-{b5}*d.l.lnN_K-{b6}*d.tfp),/*
*/instruments(d.CF d.l.lnK d.l.lnN_K d.tfp d.l3.TQ d.l4.TQ, nocons)/*
*/wmatrix(cluster gvkey) vce(cluster gvkey)
Pension Fund Equity Investment and Firm Productivity Journal of Financial and Quantitative Analysis 2026 · Table2.do:103 · pkg 14136
bootstrap _b, reps(200) cluster(Id) idcluster(newid) group(Id) seed(11244):  dario
Star Firms, Information Spillovers, and Predictable Industry-Level Outcomes Journal of Financial and Quantitative Analysis 2026 · Table_IA4_IA7_IA8_Regressions.do:133 · pkg 14137
xtabond2 nonstaregpavg l.nonstaregpavg deltaegpdifference i.year, gmm(nonstaregpavg, lag(2 4) collapse) gmm(deltaegpdifference, lag(1 2) collapse) iv(i.year) twostep robust
Foreign direct investment, prices and efficiency: Evidence from India Journal of International Economics 2026 · RTFP_NIC2_FDI_LGKP.do:87 · pkg 14422
gmm   ///
(eq1: lnY - {a0} - {bL}*lnL -{bK}*lnK - {bM}*lnM -{c1}*lnK -{c2}*lnM -{c3}*lnK_lnM -{c4}*lnK2 -{c5}*lnM2 -{c6}*lnK2_lnM -{c7}*lnK_lnM2 -{c8}*lnK3 -{c9}*lnM3   -  ///
{c10}*lnL - {c11}*lnL2 - {c12}*lnL3 - {c13}*lnL_lnK - {c14}*lnL_lnK2  - {c15}*lnL2_lnK - {c16}*lnL_lnM - {c17}*lnL2_lnM  - {c18}*lnL_lnM2 - {c19}*FDI_25 - {c20}*fms25_pnic3 - {c21}*msq - {c22}*p_ms - {c23}*lxmfg - {c24}*p2 - {c25}*price_index  ) ///
(eq2: lnY - {b0} - {bL}*lnL -{bK}*lnK - {bM}*lnM-{c1}*l1_lnK -{c2}*l1_lnM -{c3}*l1_lnK_lnM -{c4}*l1_lnK2 -{c5}*l1_lnM2 -{c6}*l1_lnK2_lnM -{c7}*l1_lnK_lnM2 -{c8}*l1_lnK3 -{c9} …
Quote Competition in Corporate Bonds The Journal of Finance 2026 · CliqTables_combined.do:207 · pkg 15632
quietly: xtabond2 `y' l.`y' `xvar', gmm(l.`y', lag(1 2)) iv(`xvar') twostep robust
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):
quietly: xtabond2 `y' l.`y' nagentLU nagentU sl20_dloginv sum_contra_sl20_dloginv nochange drat_avg loglife logage lognfund logsize d_mtn d_rule_144a d_private_placement rat_change, gmm(l.`y', lag(1 2)) iv(nagentLU nagentU sl20_dloginv sum_contra_sl20_dloginv nochange drat_avg loglife logage lognfund logsize d_mtn d_rule_144a d_private_placement rat_change) twostep robust
Bank Competition Amid Digital Disruption: Implications for Financial Inclusion The Journal of Finance 2026 · Structural_Estimation.R:565 · pkg 15636
m2 <- gmm(gmm_function, tmp[window_shock>=-3 & window_shock<0], var, upper = ub, lower = lb,
          wmatrix = "optimal",
          vcov = "iid",
          optfct = "nlminb",
          control = list(eval.max = 10000), traceIter=TRUE)
Bank Risk-Taking, Credit Allocation, and Monetary Policy Transmission: Evidence from China American Economic Journal: Macroeconomics 2026 · RunTable10.do:22 · pkg 17434
xtabond2 TFPgr lagTFPgr RiskMem_MP_POST  RiskMem_POST RiskMem_MP  Y*,
Not a Typical Firm: Capital–Labor Substitution and Firms' Labor Shares American Economic Journal: Macroeconomics 2026 · 3f_compustat_estimate_robust.do:172 · pkg 17491
capture gmm gmm_linear_cd if isample==1, nequations(1) nparameters(2) onestep instruments(1: L.v k, noconstant) from(b1 `b1' b2 `b2') conv_maxiter(100) technique(bfgs 10 dfp 10)
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):
capture gmm gmm_linear_cd if isample==1, nequations(1) nparameters(2) onestep instruments(1: L.v k, noconstant) from(b1 _b[v] b2 _b[k]) conv_maxiter(100) technique(bfgs 10 dfp 10)
How Important Is Health Inequality for Lifetime Earnings Inequality? Review of Economic Studies 2026 · HKZ_Table3.do:36 · pkg 18893
quietly xtabond2 emp L(1/`y_L').emp L0.(`xchvars') `xcntrls' `xcntrls2' if inrange(age,`a1',`a2'), robust twostep gmm(emp, lag(${ev_Lst} ${ev_Len}) collapse) gmm(`xchvars', lag(${ev_Lst} ${ev_Len}) collapse) iv(`xcntrls', equation(both)) iv(`xcntrls2', equation(level))
As we read it — macros filled in / loop expanded (an interpretation, not the file's text):
quietly xtabond2 emp L(1/2).emp L0.(frail) age age2 age3 age4 y4-y10 numkids married kidsxfem marxfem if inrange(age,25,64), robust twostep gmm(emp, lag(4 5) collapse) gmm(frail, lag(4 5) collapse) iv(age age2 age3 age4 y4-y10, equation(both)) iv(numkids married kidsxfem marxfem, equation(level))
Do capital grants improve microenterprise productivity? The Economic Journal 2026 · MyGNRestimationGH.do:144 · pkg 18940
gmm gmm_prod_CobbDouglas if vg!=. & l!=. & k!=. & vg_1!=. & l_1!=. & k_1!=., ///
    one  nequations(2) parameters(al ak) from(test3_CD) winitial(identity) rhs(vg l k vg_1 l_1 k_1) conv_maxiter(100)