*! version 1.0.1 08aug2019

Title

qmodel postestimation - Postestimation tools for qmodel

Postestimation commands

The following postestimation commands can be used after qmodel.

Command Description

predict predicts specified functions of the parameters

qmodel_plot plots specified functions of the paramters

qmodel_quantile estimates specific quantiles and their standard errors

Syntax for predict

predict newvarlist , proportion(varname) [ se ]

predict_options

proportion(varname) name of an existing variable containing proportions; this must be specified

se standard error of the prediction

Description for predict

The predict command predicts specified functions of parameters
at the proportions stored in the existing variable specified
in proportion(varname). The functions of parameters to be predicted are specified in quantile_function of qmodel using the special symbols _( and )_ or, equivalently, _[ and ]_.
Standard errors of the predicted quantiles can be obtained with the se option.

Syntax for qmodel_plot

qmodel_plot [, plot_options]

plot_options

ci shows confidence intervals of the quantiles

replace replaces previous graph

addplot(string) add other plots to the generated graph

twoway_options specifies standard options of twoway graphs

Description for qmodel_plot

The qmodel_plot command plots specified functions of the parameters against the proportion.
The functions of parameters to be predicted are specified in quantile_function of qmodel using the special symbols _( and )_ or, equivalently, _[ and ]_.

Syntax for qmodel_quantile

qmodel_quantile numlist [, quantile_options]

quantile_options

at(varname = # [...]) specifies the values of the covariates at which the quantiles are to be estimated

nlcom_options specifies standard nlcom options

Description for qmodel_quantile

The qmodel_quantile command computes point estimates, standard errors, test statistics, significance levels, and confidence
intervals for the quantile of exp_varname in qmodel at the proportions specified in numlist. The default is the median.

Examples

clear

set obs 1000

gen y = rnormal()

qmodel y = _normal

qmodel_plot

range proportion .01 .99 99

predict quantile, p(proportion)

hist y, fc(gs10) lc(gs16) freq name(a, replace)

`"twoway function invnormal(x) || line quantile p, lc(red) xtitle("p") name(b, replace)"'

gr combine a b

qmodel_quantile .5(.1).7

Predict quantiles

clear all

set obs 1000

generate x1 = rbinomial(1,.5)

generate x2 = rnormal()

generate p = runiform()

generate y = 10 + exp(.5)*invnormal(p) + log(p)*x1 + (1-p)*x2

qmodel y = _(_normal)_ + _(_log)_*x1 + _(_linear)_*x2

qmodel_plot, ci

range proportion .01 .99 99

predict base beta_x1 beta_x2, p(proportion)

qmodel_quantile .9, at(x1=0 x2=1.5) noheader

Authors

Matteo Bottai

Unit of Biostatistics

Institute of Environmental Medicine, Karolinska Institutet

Stockholm, Sweden

matteo.bottai@ki.se

Nicola Orsini

Biostatistics Team

Department of Public Health Sciences, Karolinska Institutet

Stockholm, Sweden

nicola.orsini@ki.se