*! version 1.0.0 12jun2026

Title

mmqrtest spec -- Location-scale specification /
overidentification test for the MM-QR model

Syntax

mmqrtest spec [depvar indepvars] [if] [in]
[, id(panelvar) quantile(numlist) aux(varlist)
graph name(string) noheader]

mmqrtest overid is a synonym.

Description

The MM-QR model is restrictive: covariates may affect the distribution of
Y only through the location alpha_i + X'beta and the
scale delta_i + X'gamma. Machado and Santos Silva (2019) state
that this assumption is testable, "by testing the overidentifying
restrictions resulting from augmenting [the moment conditions] with
conditions imposing the orthogonality between suitable functions of U
and functions of the regressors" (fn. 5, citing Hansen 1982 and Newey
1985), and suggest that "simpler regression-based procedures" are
possible (sec. 7). mmqrtest spec implements that regression-based
version.

Under H0 the standardized error
U = (Y - alpha_i - X'beta) / (delta_i +
X'gamma) is independent of X with E(U) = 0 and
E(|U|) = 1. Estimation already imposes orthogonality of U and
|U|-1 with X itself; the overidentifying content of H0 is
that the same orthogonality holds for additional functions w(X)
not used in estimation. Rejection signals shape effects --
covariates moving skewness, kurtosis, or tails -- or some other
departure from the location-scale family.

Methods and formulas

With U-hat from the MM-QR sequential algorithm and default auxiliary
functions w(X) = squares (and, when the regressor count is small,
pairwise products) of the regressors, three blocks of moment conditions are
examined through cluster-robust (by panel unit) Wald tests of the joint
significance of w(X) in auxiliary regressions that also control for
X:

A. location: E[w(X) U] = 0
-- regress U-hat on w(X) and X;

B. scale: E[w(X)(|U|-1)] = 0
-- regress |U-hat| on w(X) and X;

C. quantile: E[w(X)(tau - I{c -(U <= q(tau)})] = 0
for each requested tau -- checks the conditional quantiles of
U beyond the first two moments.

The overall p-value combines the three blocks by Bonferroni (block C is
itself Bonferroni-combined across tau), which is conservative.
Because U-hat embeds first-stage estimation error, the reported
asymptotic p-values are approximations; the cluster-robust construction
and the within-controls make them accurate in the designs we simulated,
but for small panels treat borderline rejections with caution (see also
the O(1/T) bias discussion in Machado and Santos Silva 2019, Theorem 4).

Observations with non-positive fitted scale are excluded from all
U-based moments; run mmqrtest scalepos first.

Options

id(panelvar), quantile(numlist) -- see mmqrtest.
The quantiles determine the tau grid of block C.

aux(varlist) replaces the default auxiliary functions w(X) by a
user-supplied list (e.g. powers, interactions with external variables).
The variables must not be collinear with the regressors.

graph draws a bar chart of the block p-values against the 0.05
reference line.

name(string) names the graph (default mmqrt_spec).

noheader suppresses the title box.

Examples

. mmqreg ln_wage tenure ttl_exp, absorb(idcode) quantile(25 50 75)

. mmqrtest spec, graph

Custom auxiliary functions:

. gen ten3 = tenure^3

. mmqrtest spec, aux(ten3)

Stored results

Scalars

r(F_loc) block A Wald F

r(p_loc) block A p-value

r(F_scale) block B Wald F

r(p_scale) block B p-value

r(p_quant) block C p-value (Bonferroni across tau)

r(df_w) number of auxiliary functions tested

r(p) overall Bonferroni p-value

Matrices

r(qtests) per-tau block C statistics (tau, F, p)

Macros

r(verdict) REJECT or NOT REJECTED

Author

Merwan Roudane --
merwanroudane920@gmail.com
-- https://github.com/merwanroudane