*! version 2.0.0 23jun2016 N.Orsini, M.Bottai
(SJ12-3: st0231_1)

Title

Postestimation tools for lqreg

Introduction

The following postestimation commands are of special interest after the most
recently fit logistic quantile regression model using lqreg:

Command Description

lqregplot plot the smoothed regression coefficients versus a dense set of quantiles

lqregpred generate and optionally plot untransformed predicted quantiles

Syntax for lqregplot

lqreqplot
[varname]
[, lqregplot_options]

lqregplot_options

quantiles(numlist) estimate # quantiles; default is quantiles(0.5)

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

reps(#) perform # bootstrap replications

seed(#) set the random-number seed

nosmooth not to smooth the plot

loptions(string) specify lowess options

generate(varname1 ...) save variables required to reproduce the plot

twoway_options add/modify the plot

Description for lqregplot

Plot the exponential value of the regression coefficient with confidence bands against a
dense set of quantiles. The default choice for estimation of confidence
intervals depends on the previously fit lqreg and estimates are
smoothed.

Options for lqregplot

quantiles(numlist) specifies the quantiles
to be estimated and should contain numbers between 0 and 1, exclusive.
Numbers greater than 1 are interpreted as percentages. The default,
quantiles(0.5), corresponds to the median.

level(#) specifies the confidence level, as
a percentage, for confidence intervals. The default is level(95)
or as set by set level.

reps(#) specifies the number of bootstrap
replications to be used to obtain an estimate of the
variance-covariance matrix of the estimators.

seed(#) sets the random-number seed.

nosmooth specifies not to smooth the plot of the regression coefficients. Smoothing is the default.

loptions(string) specifies lowess options
(for instance, bwidth() or mean) when smoothing the regression
coefficients versus the set of specified quantiles.

generate(varname1 varname2
varname3 varname4) saves the variables required to
reproduce the plot: quantile, point estimate, lower bound, and upper bound of
the regression coefficient, to be saved in varname1,
varname2, varname3, and varname4, respectively.
This option is useful if one wants to customize the plot using
graph twoway.

twoway_options modifies the plot produced by lqreg command.

Syntax for lqregpred

lqregpred
stubname
[if] [in]
[, lqregpred_options]

lqregpred_options

for(varlist) specify (partial) prediction for a quantitative covariate modeled using one or more transformations

at(var = # [...]) specify the values of the covariates not specified in for()

plotvs(varname) plot the untransformed predicted quantiles
versus a quantitative covariate

Description for lqregpred

Create new variables containing the untransformed predicted quantiles.
For instance, the new variables are named stubnameq5,
stubnameq50, and stubnameq95 if lqreg fit the quantiles
5, 50, and 95.

Options for lqregpred

for(varlist) specifies the covariate, modeled
using one or more transformations for(), for which to compute the
(partial) predicted values, evaluating the remaining covariates at the
value of 0 unless specified differently with the at() option.

at(var = # [var = #
[...]]) specifies the values of the covariates not specified in the
for() option. at() works only if the for() option is also specified.

plotvs(varname) creates plots of the untransformed predicted quantiles
versus a quantitative covariate.

Examples

Setup

sysuse auto, clear

lqreg mpg weight

Predicted quantiles

lqregpred predq, plotvs(weight)

Plot smoothed regression coefficients versus a set of quantiles

lqregplot weight, quantiles(.1(.1).9)

Authors

Nicola Orsini

Department of Public Health Sciences, Karolinska Institutet

Stockholm, Sweden

nicola.orsini@ki.se

Matteo Bottai

Unit of Biostatistics

Institute of Environmental Medicine, Karolinska Institutet

Stockholm, Sweden

matteo.bottai@ki.se

Also see

Article: Stata Journal, volume 12, number 3: st0231_1,

Stata Journal, volume 11, number 3: st0231

Help: lqreg (if installed)