*! version 1.3 10 Feb 2020
help xtqreg

Title

xtqreg -- Quantile regression with fixed effects

Syntax

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

options

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

id specifies the variable defining the panel

ls displays the estimates of the location and scale parameters

savefe(newvar) saves the fixed effects for each estimated quantile

predict(newvar) saves the fitted values for each estimated quantile

indepvars may contain factor variables; see fvvarlist.

xtqreg does not allow weights.

Description

xtqreg estimates quantile regressions with fixed effects using the method of Machado and Santos Silva (2019).

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 the regression will be estimated
for each quantile.

id(panelvar) specifies that the variable defining the panel is panelvar.

ls displays the estimates of the location and scale parameters

savefe(newvar)saves the fixed effects for each estimated quantile in a variable whose
name starts with newvar

predict(newvar)saves the fitted values for each estimated quantile in a variable whose
name starts with newvar

Remarks

xtqreg was written by J.A.F. Machado and J.M.C. Santos Silva and it is not an
official Stata command; we are grateful to Fernando Rios-Avila for help writing this 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

. sysuse auto

Median regression with fixed effects for headroom

. xtqreg price weight length i.foreign, i(headroom)

Estimate .25 quantile with fixed effects for headroom

. xtqreg price weight length i.foreign, i(headroom) quantile(.25)

Estimate the nine deciles with fixed effects for headroom

. xtqreg price weight length i.foreign, i(headroom) quantile(.1(0.1)0.9)

Median regression with fixed effects for headroom reporting the location and scale estimates

. xtqreg price weight length i.foreign, i(headroom) quantile(.25) ls

Saved results

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

Scalars

e(N) number of observations

Macros

e(cmd) xtqreg

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, xtqreg 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

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] xtreg