*! version 2.0.0 12jul2026 Dr Merwan Roudane

Title

xtbchpanel -- Bias-corrected mean-group long-run estimators for dynamic
heterogeneous panels (ARDL), with an optional climate-deviation mode

Syntax

xtbchpanel
depvar indepvars
[if] [in]
[, options]

Model
lags(p q) ARDL orders: p lags of depvar, q lags of each regressor;
default lags(1 4)

difference first-difference depvar and all regressors before
estimation (e.g. growth models)

cce add a lagged cross-section average of depvar as a common-correlated-
effects control

world(varname) use this series (lagged) as the CCE control instead of the CSA

Climate-deviation mode (optional)
ma(numlist) apply the annualized deviation transform with these norm window(s) m

mavars(varlist) regressors to transform to (2/(m+1))|x - MA_m(x)|; default all

Estimators
methods(list) subset of mg hpjmg bc1 bc2 bc3 tmg hpjfe; default all

alphatrim(#) TMG trimming exponent, a_n=C_n*n^(-#); default 1/3

reps(#) AWB bootstrap replications for BC2; default 199

seed(#) RNG seed; default 12345

rho(#) AR parameter of the autoregressive wild bootstrap; default 0.10

Subgroups / reporting
by(varname) report each estimator within groups of varname

level(#) confidence level; default 95

graph distribution and forest plots

gname(str) stub for saved graph names

plotvar(varname) regressor used for the plots; default first

plotma(#) window used for the theta-distribution plot

nodots suppress bootstrap progress dots

The panel must be xtset. Unbalanced panels and internal gaps are handled.

Description

xtbchpanel estimates the long-run effect of each regressor in a dynamic
heterogeneous panel and averages the unit-specific effects with a family of
bias-corrected and trimmed mean-group estimators. For each cross-section unit i it fits,
by OLS, the ARDL(p,q) model

y(i,t) = a(i) + {&Sigma}(l=1..p) {&phi}(i,l) y(i,t-l)
+ {&Sigma}(k) {&Sigma}(l=0..q) {&beta}_k(i,l) x_k(i,t-l) [+ {&gamma}(i) cce(i,t-1)] + u(i,t),

and forms the long-run coefficient of each regressor k,
theta_k(i) = [{&Sigma}_l {&beta}_k(i,l)] / [1 - {&Sigma}_l {&phi}(i,l)]. These are
general dynamic-panel long-run estimators (Pesaran & Smith 1995; Chudik & Pesaran 2015;
Kiviet & Phillips 1993; Pesaran & Zhao 1999; Pesaran & Yang 2024; Chudik, Pesaran & Yang
2018) and apply to any field, not only climate.

Climate-macro mode. Adding difference, mavars()+ma() and cce
reproduces the climate-growth specification of Centorrino, Massetti, Mohaddes, Raissi &
Yang (2026) and Kahn et al. (2021): depvar becomes growth, the climate regressor
becomes the annualized deviation from its m-year norm, and the world-growth CCE term is
included. A separate table column is produced per norm window m.

Output layout adapts automatically: without ma(), columns are the regressors (one
table per group); with ma(), columns are the norm windows (one table per regressor),
matching the source paper's tables. A pooled homogeneous HPJ-FE benchmark is reported
alongside.

Estimators

MG Mean Group average of theta_k(i) (Pesaran & Smith 1995)

HPJ-MG Half-Panel Jackknife MG (Chudik & Pesaran 2015)

BC1 analytical bias correction (Kiviet & Phillips 1993 COLS; exact for p=1)

BC2 bootstrap bias correction (Pesaran & Zhao 1999) via the Autoregressive
Wild Bootstrap (Smeekes & Urbain 2014)

BC3 Half-Panel Jackknife on the short-run vector, long-run per unit, averaged

TMG preferred: Trimmed Mean Group (Pesaran & Yang 2024)

HPJ-FE pooled homogeneous benchmark with Chudik-Pesaran-Yang (2018) Prop-4 SE

Options

lags(p q) sets the ARDL orders. BC1 (Kiviet-Phillips) is exact only for a
single lagged dependent variable (p=1); for p>1 it returns the uncorrected estimate.

difference runs the whole model in first differences. cce / world()
add the common-factor control (a lagged cross-section average of the dependent, or a
user-supplied series).

ma(numlist) + mavars(varlist) turn on the climate-deviation transform
(2/(m+1))|x - MA_m| on the named regressors, sweeping the listed norm windows. The
transform is applied on levels, before any difference.

methods(), alphatrim(), reps(), seed(), rho() control
the estimator set and the TMG / AWB tuning. by() produces subgroup tables.

Examples

General dynamic panel, long-run effects of two regressors:

. xtset firm year

. xtbchpanel sales price adspend, lags(1 2)

Growth model in first differences with a common-factor control:

. xtbchpanel lgdp inv trade, difference cce lags(1 3)

Climate-macro specification (Centorrino et al. 2026):

. xtbchpanel lgdppc temp, difference mavars(temp) ma(20 30 40 50) cce lags(1 4)

Subgroups and graphs:

. xtbchpanel lgdppc temp pcp, difference mavars(temp pcp) ma(30) by(zone) graph

A self-testing known-truth simulation ships as xtbchpanel_example.do.

Stored results

Scalars

e(p), e(q), e(kx) ARDL orders and number of regressors

e(nma), e(hasma), e(ngroups) windows, climate-mode flag, groups

Macros

e(cmd) xtbchpanel

e(depvar), e(lrvars), e(mavars) dependent, regressors, transformed vars

e(methods), e(ma), e(byvar), e(difference) specification

Matrices

e(b_all), e(se_all) long-run estimates / SEs; rows = group x estimator,
cols = regressor x window

e(hpjfe_b), e(hpjfe_se), e(hpjfe_phi) pooled benchmark

e(N_g) units per cell

e(theta_i) per-unit theta for the plot regressor: id, group, MG, HPJ, TMG

e(b), e(V) preferred (TMG) long-run effect of the plot regressor

References

Centorrino, S., E. Massetti, K. Mohaddes, M. Raissi, and J.-C. Yang. 2026.
Macroeconomic Consequences of Sustained Warming. Cambridge WP in Economics 2617.

Chudik, A., and M. H. Pesaran. 2015. Journal of Econometrics 188(2): 393-420.

Chudik, A., M. H. Pesaran, and J.-C. Yang. 2018. J. Applied Econometrics 33(6): 816-836.

Kiviet, J. F., and G. D. A. Phillips. 1993. Econometric Theory 9(1): 62-80.

Pesaran, M. H., and R. P. Smith. 1995. Journal of Econometrics 68(1): 79-113.

Pesaran, M. H., and Z. Zhao. 1999. In Analysis of Panels and LDV Models, 297-322. CUP.

Pesaran, M. H., and L. Yang. 2024. Trimmed Mean Group Estimation. CWPE 2364.

Smeekes, S., and J.-P. Urbain. 2014. Autoregressive Wild Bootstrap. Maastricht University.

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

github.com/merwanroudane