help genqreg

Title

genqreg -- Generalized Quantile Regression (GQR)

Syntax

genqreg
depvar indepvars [if] [in] [weight] ,
[quantile(#)
instruments(varlist)
proneness(varlist)
technique(string)
optimize(string)
MCMC options
Grid-search options
]

Description

genqreg can be used to fit the generalized quantile regression estimator developed
in Powell (2016).
The generalized quantile estimator addresses a fundamental problem posed by traditional
quantile estimators: inclusion of additional covariates alters the interpretation of
the estimated coefficient on the treatment variable. As detailed in
Powell (2016), the
generalized quantile estimator implemented by genqreg
addresses this problem and produces unconditional quantile treatment effects even in the presence of additional
control variables. A special case of generalized quantile regression is quantile
regression with panel data (see
Powell (2015));
quantile regression with panel data can also be estimated using genqreg.

Numerical optimization proceeds via a Nelder-Mead algorithm. As estimation and calculation of
standard errors can sometimes pose numerical challenges,
the user can estimate generalized quantile regressions using
Markov Chain Monte Carlo methods or grid-search methods.

Syntax

genqreg is invoked in the usual way - the command name, followed by the
dependent variable, followed by control variables. One can then specify options after a comma.

Options

quantile(#) specifies the quantile to be estimated and should be a number between 0 and 1, exclusive.
Numbers larger than 1 are interpreted as percentages. The default value of 0.5 corresponds to the median.

instruments(varlist) All exogenous explanitory variables and any addtional
instrumental variables must be included in instruments(varlist). If no variables
are included in instruments(varlist), then it is assumed all the RHS variables
are exogenous.

proneness(varlist) Proneness variables are additional controls
that allow the user to control for additional features
that might impact the a unit's placement in the putcome distribution.

technique(string) As explained in
Powell (2016),
the estimator requires predicting the probability the outcome is below the quantile funciton
conditional on the specified proneness variables in proneness(varlist).
The user may specify the model used to estimate this probability including:
technique("logit"), technique("probit"), or
technique("linear"). While specifying logit or probit
restricts the expectation to the [0,1] interval, it may also prove time consuming.
Linear is the default.

optimize(string) Three optimization techniques can be used to estimate genqreg:
Nelder-Mead (default), adaptive MCMC and
Grid-search.

Nelder-Mead Options

nmsimplex(string) A Stata matrix for the NM simplex. See moptimize Nelder-Mead

MCMC Options

To use the adaptive MCMC optimization procedure specify optimize("mcmc").
For further help see help mf_amcmc if installed.

draws(#) tells the algorithm how many draws to perform

burn(#) tells the algorithm how many draws to drop as a burn-in period;
accordingly, the algorithm returns only the last draws(#)-burn(#) draws.

arate(#) acceptance rates of the algorithm. Must be between 0 and 1.
The default is 0.234.

sampler(string) a string scalar specifying the drawing scheme desired by the user.
sampler("mwg") is Metropolis-within-Gibbs sampling (each component of the function is sampled alone and in order).
sampler("global") is global, all-at-once sampling (defualt).

dampparm(#) is an adjustment parameter telling the algorithm how agressively or conservatively to adapt the proposal distribution to achieve the
acceptance rate specified by the user in arate(#). dampparm(#) should lie between zero and one, with values closer to zero corresponding with slower
adaptation, and values closer to one corresponding to more rapid adaptation to the proposal history. The defualt is 0.234.

from(string) initial parameter values EXCLUDING the constant. This must be a Stata matrix.
If left blank, starting values are from qreg.

fromvariance(#) initial covariance matrix EXCLUDING the constant. This must be a Stata matrix.
If left blank, starting values are from qreg.

saving(string) specifies a location to store the draws of the parameters. The file will contain just the draws after
any burn-in period or thinning of values is applied.

replace specifies that an existing file is to be overwritten with parameter draws.

append specifies that an existing file is to be appended with parameter draws.

thin(int) specifies that only every #th draw is to be retained, so if thin(3) is specified, only every
third draw is retained. This option is designed to help ease autocorrelation in the resulting draws, as is the option
jumble, which randomly mixes draws. Both options may be applied.

jumble specifies that retained draws are to be jumbled. This helps reduce autocorrelation between draws.

noisy If specified, the algorithm produces feedback - each time the target
distribution is evaluated, it produces a "." as output, while after 50 calls, it produces
the value of the target distribution.

usemax By default, the mean of the MCMC draws are reported as the coefficient "estimates" to match Stata conventional output.
By specifying the option usemax, the set of draws that correspond to the maximum objective function value are reported.

Grid-search Options

To use the grid-search optimization procedure specify optimize("grid").
A maximum of two RHS variables may be used with the grid-search optimization procedure.
As such, you will need to specify the minimum, maximum and interval for each variable's grid.

grid1(numlist) Grid for first independent variable.

grid2(numlist) Grid for second independent variable.

Examples

Setup (see Chernozhukov and Hansen, 2008)

. use "http://fmwww.bc.edu/repec/bocode/j/jtpa.dta"

. keep if sex==1

Robust quantile regression

. qreg earnings training hsorged black hispanic married wkless13
class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms, q(85)
vce(robust)

Same as above, but using MCMC methods

. genqreg earnings training hsorged black hispanic married wkless13
class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms, q(85)
optimize(mcmc) noisy draws(10000) burn(3000) arate(.5)

Robust instrumental variable quantile regression. MCMC optimization.

. genqreg earnings training hsorged black hispanic married wkless13
class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms, q(85)
optimize(mcmc) noisy draws(10000) burn(3000) arate(.5)
instruments(assignmt hsorged black hispanic married wkless13
class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms)

Specifying control variables as proneness variables. MCMC optimization.

. genqreg earnings training, q(85)
proneness(hsorged black hispanic married wkless13
class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms)
optimize(mcmc) noisy draws(10000) burn(3000) arate(.5)

Same as above, but with an IV. MCMC optimization.

. genqreg earnings training, q(85) instrument(assignmt)
proneness(hsorged black hispanic married wkless13
class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms)
optimize(mcmc) noisy draws(10000) burn(3000) arate(.5)

Same as above, but with an IV. Grid-search optimization.

. genqreg earnings training, q(85) instrument(assignmt)
proneness(hsorged black hispanic married wkless13
class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms)
optimize(grid) grid1(1000(50)3500)

Saved results

genqreg saves the following in e():

Scalars

e(N) number of observations

Macros

e(cmd) "genqreg"

e(title) "Generalized Quantile Regression"

e(indepvars) Right-hand side variables

e(depvar) Left-hand side variable

e(technique) Technique used in forming expected quantile

Matrices

e(b) Parameter values

e(V) Variance-covariance matrix of parameters

e(solutions) Parameter values from grid search; may contain multiple solutions.

Functions

e(sample) marks estimation sample

Reference

Chernozhukov, Victor and Christian Hansen. 2008.
Instrumental variable quantile regression: A robust inference approach. Journal of Econometrics 379-98.

Powell, David. 2016.
Quantile Treatment Effects in the Presence of Covariates. RAND Labor and Population Working Paper.

Powell, David. 2015.
Quantile Regression with Nonadditive Fixed Effects.
RAND Labor and Population Working Paper.

Authors

This command was written by Matthew J. Baker (matthew.baker@hunter.cuny.edu), David Powell (dpowell@rand.org), and Travis Smith
(tasmith@uga.edu). Comments, criticisms, and suggestions for improvement are welcome.

Also see

Manual: quantile

Other: Quantile Regression for Panel Data (QRPD), if installed:
qregpd