*! version 1.0.0 16dic2015
help xtqreg

Title

xtqreg -- Linear Quantile Mixed Models

Syntax

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

xtqreg_options

Model
quantiles(#[#[# ...]]) estimate # quantiles; default is quantiles(.5)

reps(#) perform # bootstrap replications; default is reps(20)

method(string) specifies the optimization algorithm

random(varlist) specifies the random effects

covariance(xtqreg##vartype:vartype) specifies the variance-covariance of the random effects

noconstant suppress constant term

Paths
pathr(R_pathname) specifies a path name for invoking the R command

version(R_version) specifies the R version to use

directory(pathname) defines the working directory

Reporting
level(#) set confidence level; default is level(95)

vartype

independent one variance parameter per random effect,
all covariances zero; the default unless a factor variable is specified

exchangeable equal variances for random effects,
and one common pairwise covariance

identity equal variances for random effects, all
covariances zero; the default for factor variables

unstructured all variances and covariances distinctly
estimated

See [R] sqreg postestimation for features
available after estimation.

Description

xtqreg is used to fit linear quantile mixed models based on the asymmetric Laplace distribution.
The command xtqreg is a wrapper for the lqmm package developed by Marco Geraci in
R. Therefore R needs to be installed together with the package lqmm.

Options for xtqreg

Model

quantiles(# [# [# ...]]) specifies the quantiles as numbers between 0 and 1;
numbers larger than 1 are interpreted as percentages. The default value is 0.5, which corresponds to the median.

reps(#) specifies the number of bootstrap replications for estimating
variance-covariance matrix and standard errors of the regression coefficients.

random specifies the random effects. The default is the intercept.

method specifies the optimization algorithm.
The optimization algorithm is based on the gradient of the Laplace log-likelihood (gs), the default.
An alternative optimization algorithm is based on a Nelder-Mead algorithm (df).

noconstant; see
[R] estimation options.

Paths

pathr(R_pathname) specifies the path name for invoking the R command.
The default path is "C:\Program Files\R\R-3.1.3\bin\x64\R.exe". The R version
can be changed with option version().
The R_pathname can also be set by defining a global macro Rterm_path
(See rsource, Technical note).

version(R_version) defines the working R version. The default is "3.1.3".

directory(pathname) defines the working directory.
The default directory is the current directory. If the current directory is on the
server the program will return an error. The alternative directory must
be on the local computer.

Reporting

level(#); see
[R] estimation options.

Examples

Set the path for Windows

\Program Files\R\R-3.1.3\bin\i386\Rterm.exe""'

Set the path for Mac

`"global Rterm_path "/usr/bin/r""'

use http://www.imm.ki.se/biostatistics/data/wtloss, clear

reshape long y, i(id) j(month)

gen inter = month*prog

xtset id month

Random intercept

xtqreg y prog month inter

Random intercept and multiple quantiles

xtqreg y prog month inter, q(25 50 75)

Random intercept and random slope

xtqreg y prog month inter, random(month)

References

Geraci M and Bottai M (2007). Quantile regression for longitudinal data using the asymmetric Laplace distribution. Biostatistics 8(1), 140-154.

Bottai M, Orsini N and Geraci M (2014). A Gradient Search Maximization Algorithm for Laplace Likelihood. Journal of Statistical Computation and Simulation.

Geraci M and Bottai M (2014). Linear Quantile Mixed Models. Statistics and Computing. May 2014, Volume 24, Issue 3, pp 461-479.

Geraci M (2014). Linear Quantile Mixed Models: The lqmm Package for Laplace Quantile Regression. Journal of Statistical Software. Vol. 57, Issue 13, May 2014.

Also see

Manual: [R] qreg

Online: [R] qreg postestimation;

[R] bootstrap