← Methods
GMM
201
packages run it, of 7,459 whose models we parsed
200
papers
2,241
estimation commands
Adoption over time
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)
gmm119xtabond256xtabond24xtdpd9pgmm2xtdpdgmm2ivgmm1
Inference (of the 201 packages running the dedicated estimator)
default95robust75cluster45hac12bootstrap4
Clustering variables (of the 201 packages running the dedicated estimator)
id6ccode3countrycode2newid2`vcec'1characteristics_ptf1city_pair1cluster1
Absorbed fixed effects (of the 201 packages running the dedicated estimator)
month_ids1product_ids1store_ids1year_ids1
Foundational works
What the papers whose code runs this estimator cite most (share of those papers citing each).
- Some Tests of Specification for Panel Data: Monte Carlo Evidence and an Application to Employment Equations — Manuel Arellano; Stephen Bond (1991), Review of Economic Studies41 · 20%
- Initial conditions and moment restrictions in dynamic panel data models — Richard Blundell; Stephen Bond (1998), Journal of Econometrics34 · 17%
- Econometric Analysis of Cross Section and Panel Data — Jeffrey M. Wooldridge (2002), MIT Press19 · 10%
- Biases in Dynamic Models with Fixed Effects — Stephen Nickell (1981), Econometrica15 · 8%
- Estimating Production Functions Using Inputs to Control for Unobservables — James Levinsohn; Amil Petrin (2003), Review of Economic Studies14 · 7%
- The Dynamics of Productivity in the Telecommunications Equipment Industry — G. Steven Olley; Ariel Pakes (1996), Econometrica14 · 7%
- Identification Properties Of Recent Production Function Estimators — Daniel A. Ackerberg; Kevin Caves; Garth Frazer (2015), Econometrica13 · 6%
- Another look at the instrumental variable estimation of error-components models — Manuel Arellano; Olympia Bover (1995), Journal of Econometrics13 · 6%
- The Rise of Market Power and the Macroeconomic Implications — Jan De Loecker; Jan Eeckhout; Gabriel Unger (2020), Quarterly Journal of Economics12 · 6%
- Bartik Instruments: What, When, Why, and How — Paul Goldsmith-Pinkham; Isaac Sorkin; Henry Swift (2020), American Economic Review12 · 6%
- GMM Estimation with persistent panel data: an application to production functions — Richard Blundell; Stephen Bond (2000), Econometric Reviews12 · 6%
- Markups and Firm-Level Export Status — Jan De Loecker; Frederic Warzynski (2012), American Economic Review12 · 6%
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)