*! version 1.5 4 Mar 2023
help ivqreg2

Title

ivqreg2 -- Structural quantile function estimation

Syntax

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

options

quantile(#[#[# ...]]) estimate # quantile; default is quantile(.5)

instruments(varlist) list of instruments, including control variables; by default no instruments are
used and restricted quantile regression is performed

ls displays the estimates of the location and scale parameters

musigma uses a simpler method to choose the starting values; this was the default in earlier versions

gmm options gmm options to control the maximization process

ivqreg2 does not allow weights.

Description

ivqreg2 estimates the structural quantile functions defined by Chernozhukov and Hansen (2008) using the method of Machado and Santos Silva (2019). If no instruments are
specified, ivqreg2 estimates the regression quantiles imposing the restriction that quantiles do not cross (see also of He, 1997).

Options

quantile(#[#[# ...]]) specifies the quantile to be estimated and should be
a number strictly between 0 and 1. The default value of 0.5 corresponds to the median.
The quantiles can be specified as a list, in which case estimation will be performed
for each quantile.

instruments(varlist) list of instruments, including control variables; by default no instruments are
used and restricted quantile regression is performed

ls displays the estimates of the location and scale parameters

musigma uses a simpler method to choose the starting values and allows the replication of the results obtained with earlier versions of the commanad

gmm options:
onestep,
twostep,
quickd,
winitial(string),
technique(string),
conv_maxiter(#),
tracelevel(string),
conv_ptol(#),
conv_vtol(#),
conv_nrtol(#),
from(init_specs); see [R] gmm for more details.

Remarks

ivqreg2 was written by J.A.F. Machado and J.M.C. Santos Silva and it is not an
official Stata command. For further help and support, please contact jmcss@surrey.ac.uk. Please notice
that this software is provided as is, without warranty of any kind, express or implied, including but
not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement.
In no event shall the authors be liable for any claim, damages or other liability, whether in an action
of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other
dealings in the software.

Examples

Setup: import Kathryn Graddy's fish data

. import delimited "https://tinyurl.com/Graddy-data"

Structural quantile functions for a range of quantiles using stormy and rainy as instruments for price

. ivqreg2 qty price, inst(stormy rainy) q(0.15 .25 .5 .75 .85)

Same regression as above but including day dummies as controls

. ivqreg2 qty price day*, inst(stormy rainy day*) q(0.15 .25 .5 .75 .85)

Structural median using stormy as an instrument for price; location and scale estimates are reported

. ivqreg2 qty price, inst(stormy) ls

Restricted regression quantiles for a range quantiles

. ivqreg2 qty price, q(0.1(0.1).9)

Saved results

When only one quantile is estimated, ivqreg2 saves the following results in e():

Scalars

e(N) number of observations

e(Q) GMM criterion

e(converged) 1 if converged, 0 otherwise

Macros

e(cmd) ivqreg2

e(depvar) name of dependent variable

e(properties) b V

Matrices

e(b) coefficient vector

e(V) covariance matrix

e(q) estimated quantile of the scaled errors

e(b_location) location-coefficients vector

e(V_location) location-coefficients covariance matrix

e(b_scale) scale-coefficients vector

e(V_scale) scale-coefficients covariance matrix

Functions

e(sample) marks estimation sample

If multiple quantiles are estimated, ivqreg2 also saves b, V, and q for each quantile with names of the form (for the first quartile) e(b_25), e(V_25), and e(q_25). In this case, the matrices e(b), e(V), and e(q) contain the results for the last estimated quantile.

References

Chernozhukov, V. and Hansen, C. (2008). "Instrumental Variable Quantile Regression: A Robust Inference Approach," Journal of Econometrics, 142, 379-398.

He, X. (1997). "Quantile Curves Without Crossing," The American Statistician, 51, 186-192.

Machado, J.A.F. and Santos Silva, J.M.C. (2019), Quantiles via Moments, Journal of Econometrics, 213(1), pp. 145-173.

Also see

Manual: [R] gmm