This repository hosts the Stata command xtlp for panel local projections with split-panel jackknife (SPJ) estimator proposed by
- Ziwei Mei, Liugang Sheng, Zhentao Shi (2026), "Nickell Bias in Panel Local Projection: Financial Crises Are Worse Than You Think", Journal of International Economics, 104210.
External repositories:
-
panel-lp-replication is the repository that offers replication code for simulations and empirical applications in the paper.
-
panel-local-projection is the repository that offers the package
pLPinRto implement the panel local projection that includes FE and SPJ two methods. -
panel-local-projection-py is a
pythonpackage that replicated from the R counterpart.
xtlp depvar indepvars [if] [in], method(method_name) [fe tfe hor(numlist) ytransf(transf_name) shock(integer) graph]xtlp estimates the dynamic impulse response functions (IRFs) in panel data using the Local Projection (LP) method. It offers two estimators via method(): the standard fixed-effect estimator (method(fe)) and the split-panel jackknife estimator (method(spj)). The SPJ estimator addresses the intrinsic Nickell bias in dynamic settings.
When LPs are estimated with fixed effects in short panels, the dynamic structure of the predictive equation induces the Nickell bias in the FE estimator, even if no lagged dependent variable appears explicitly in indepvars. This bias invalidates standard inference based on the FE t-statistics. The SPJ estimator implemented here in this command provides a simple and effective bias-correction. It restores valid statistical inference in panel LPs.
The command performs a single-equation estimation under the specified fixed-effect structure (fe or tfe). Given depvar and indepvars, xtlp applies the chosen estimator (method(fe) or method(spj)) to produce coefficient estimates. The variance–covariance matrix (VCE) of the coefficients is controlled by vce(). Five variance estimators are supported: homoskedastic (unadjusted, the default), heteroskedasticity-robust (robust), one- and two-way cluster-robust (cluster), and Driscoll–Kraay (dkraay).
For multiple horizons, xtlp automates the IRF construction over the range specified in hor(). It generates horizon-specific transformed dependent variables via ytransf(), runs a regression for each horizon, and compiles the results. The option shock() allows users to treat several leading regressors as shocks; xtlp then reports the IRFs and, if requested, produces IRF plots via graph.
Use the Stata command below to install the most recent published version of xtlp.
net install xtlp, from("https://raw.githubusercontent.com/shenshuuu/panel-local-projection-stata/main/") replace
or
github install shenshuuu/panel-local-projection-stata, replace
Stata version 14 or later is required for this package of commands.
- 2025-12-10: version 1.0.0 — Initial stable version.
- 2026-01-22: version 1.0.1 — Bug fix in missing value deletion;
ytransf()behavior restricted. - 2026-07-27: version 1.1.0 — Full VCE support
vce()(unadjusted/robust/cluster/dkraay+ase/nodfadj) andkeepsingletonsoption.
Shu SHEN shushen@link.cuhk.edu.hk
MIT