*! version 1.0.1 27may2026

Title

nqar -- Network Quantile Autoregression (Zhu et al. 2019)

Syntax

nqar depvar [if] [in],
network(name) [options]

Main
network(name) name of a Stata matrix (default) or Mata matrix that holds the N x N adjacency matrix W

mata declare that network() refers to a Mata matrix instead of a Stata matrix

rowstd row-standardise W (divide each row by its sum); recommended unless W is already row-stochastic

quantile(numlist) quantile(s) at which to estimate; default 0.5

z(varlist) time-invariant nodal covariates (constant within unit)

factors(varlist) time-varying common factors (constant within time)

plags(#) number of lags of the common factors to include (default 0)

Inference
bandwidth(HS|HB) Powell SE bandwidth: Hall-Sheather (default) or Bofinger

bscale(#) multiplicative scale for the bandwidth (default 1); use 3 with HS or 0.6 with HB to match Koenker-Xiao (2006)

level(#) confidence-interval level; default 95

Cosmetic
title(string) custom title to display above the table

notable suppress the textual table; useful inside loops

Description

nqar estimates the Network Quantile Autoregression model of Zhu,
Wang, Wang and Härdle (2019, Journal of Econometrics). For each
quantile tau in (0,1) the conditional quantile of depvar given the
information set is

QY(tau | F_t) = beta0(tau) + Z'gamma(tau)
+ beta1(tau) (1/n_i) sum_j a_{ij} Y_{j,t-1}
+ beta2(tau) Y_{i,t-1}

where W = {a_ij/n_i} is the row-standardised adjacency matrix, Z are
time-invariant nodal characteristics and beta1, beta2, gamma
are tau-specific coefficient functions. Because only lagged network
terms appear on the right-hand side, the model is identified by standard
quantile regression and consistency follows from the usual conditions on
xtset panel data, with no need for instrumentation. See dnqr
for the extended model that allows contemporaneous network
spillovers.

The estimator runs qreg once per quantile, retrieves the residuals,
and computes Powell (1986) sandwich standard errors using the
Hall-Sheather (1988) or Bofinger (1975) bandwidth following Koenker and
Xiao (2006). Optional time-varying common factors F_t (with up to plags(#)
lags) are appended to the regressor list and treated as exogenous.

Options

network(name) specifies the N x N adjacency or weights
matrix W. By default nqar expects a Stata matrix; add option
mata when W lives in Mata. W must have the same number of rows
as the number of distinct panel ids in the estimation sample. Use
rowstd to row-standardise W on the fly.

mata indicates that name in network() refers to a
Mata matrix. The matrix is read once with st_matrix().

rowstd divides each row of W by its row sum (the
sociomatrix convention). Recommended unless W is already row-stochastic.

quantile(numlist) sets the quantile grid; multiple values
are accepted, e.g. quantile(0.1 0.25 0.5 0.75 0.9). The default
is the median, quantile(0.5).

z(varlist) adds time-invariant nodal covariates (the first
non-missing value within id is used).

factors(varlist) adds time-varying common factors (the
first non-missing value within each time period is used). Combine with
plags(#) to include lags F_{t-1}, F_{t-2}, ....

bandwidth(HS|HB) sets the Powell-bandwidth family. HS is
Hall-Sheather (1988) and HB is Bofinger (1975); see Koenker and Xiao
(2006) for guidance.

bscale(#) multiplies the chosen bandwidth. Useful values
are 1 and 3 with HS or 0.6 with HB (Koenker-Xiao 2006).

level(#) sets the confidence-interval level.

Examples

. * simulate a panel + adjacency matrix W

. dnqr_simulate, n(80) t(40) gamma1(0) gamma2(0.30) gamma3(0.30) z(2) factors(2) clear wname(W)

. * fit the NQAR model at five quantiles

. nqar y, network(W) rowstd quantile(0.1 0.25 0.5 0.75 0.9) z(Z1 Z2) factors(F1 F2)

. * plot the quantile process

. dnqr_plot WY_L1 Y_L1

. * tail-event impulse for the median quantile

. dnqr_impulse, network(W) rowstd horizon(8) quantile(0.5) shocknode(1) plot

Stored results

nqar stores the following in e().

Scalars

e(plags) number of lags of F

e(level) CI level

e(bscale) bandwidth scale

e(netdens) network density

Macros

e(cmd) nqar

e(cmdline) command as typed

e(depvar) name of the dependent variable

e(zvars) nodal covariates

e(factors) common factors

e(bandwidth) HS or HB

e(panelvar) xtset panel variable

e(timevar) xtset time variable

Matrices

e(quantile) 1 x q vector of quantiles

e(b_q) coefficients, one column per quantile

e(se_q) Powell standard errors

e(t_q) z-statistics

e(p_q) two-sided p-values

e(lo_q) lower confidence limit

e(hi_q) upper confidence limit

References

Koenker, R., and Z. Xiao. 2006. Quantile autoregression. Journal of
the American Statistical Association 101: 980-990.

Powell, J. L. 1986. Censored regression quantiles. Journal of
Econometrics 32: 143-155.

Zhu, X., W. Wang, H. Wang, and W. K. Härdle. 2019. Network quantile
autoregression. Journal of Econometrics 212(1): 345-358.

Also see

Package TOC: dnqrlib

DNQR with contemporaneous network: dnqr

Postestimation: dnqr_postestimation, dnqr_plot,
dnqr_impulse

Simulator: dnqr_simulate

Stata builtin: qreg, xtset

Author: Dr Merwan Roudane -
merwanroudane920@gmail.com