*! version 1.0.2 Nicolai T. Borgen 15june2022
help rqrplot

Title

rqrplot -- Graphing quantile regression coefficients after RQR

Syntax

rqrplot [, bopts(string) ciopts(string) twopts(string)
level(#) bootstrap(string) nodraw notabout
noci]

options

bopts(string) allows for the customizing the display of the
coefficients. The default is solid line graph. See twoway options
for other line options.

ciopts(string) allows for customizing the confidence intervals.
The default is area plot with opacity set at 40%. See twoway options
for other options.

twopts(string) allows for customizing the overall graph, including
title and labels. See twoway_options options
for various options.

level(#) decides the confidence level for the confidence intervals,
where # is any number between 10.00 and 99.99. The default is 95% confidence interval.

bootstrap(string) requests normal-approximation bootstrap CIs
(bootstrap(normal)), percentile bootstrap CI (bootstrap(percentile)),
or bias-corrected bootstrap CI (bootstrap(bc)). The default is
normal-approximation when rqr is estimated with the bootstrap
prefix.

nodraw suppresses the display of the twoway plot.

notabout suppresses the display of the result matrix.

noci plots the coefficients without confidence intervals.

Description

rqrplot is a rqr postestimation command that effortless plots
quantile regression coefficients and their confidence intervals. It visualizes
the coefficients and the confidence intervals based on the current estimation
results from the rqr model.

The rqrplot postestimation command only works after the rqr
command.

See Borgen, Haput, and Wiborg (2021b)
for descriptions and examples of the rqr and rqrplot commands.

Examples: Basic usage

Setup

. webuse nlswork

Estimate treatment effects for quantiles 0.03 to 0.097 at steps of .02 using rqr.

. rqr ln_wage union, quantile(.03(.02).97) controls(year c.grade##c.grade south i.ind_code)

Plot treatment coefficients using defaults.

. rqrplot

Examples: Customize graph layout

Change line pattern from solid to dash.

. rqrplot, bopts(lpattern(dash))

Change colors of line and CIs.

. rqrplot, bopts(color(red)) ciopts(color(red%40))

Change line plot to connected plot.

. rqrplot, bopts(recast(connected))

Change markers of connected plot.

. rqrplot, bopts(recast(connected) msymbol(square) msize(vsmall))

Change area CIs to line CIs.

. rqrplot, ciopts(recast(rline))

Change confidence level, here with 70% CIs.

. rqrplot, level(70)

Add overall title and change the default y-titles.

. rqrplot, twopts(title(Union wage effects) ytitle(QTE))

Remove grid lines.

. rqrplot, twopts(ylabel(,nogrid) xlabel(,nogrid))

Suppress the confidence intervals.

. rqrplot, noci

Names for graph are specified in twopts(string).

. rqrplot, twopts(name(union_effects, replace))

Combine some of the different options mentioned above.

. rqrplot, bopts(recast(connected) color(red) msymbol(oh)) ciopts(color(red%40)) twopts(title(Union wage effects) ytitle(QTE))

Examples: Bootstrapped confidence intervals

To get bootstrapped CIs, we first need to run rqr with the bootstrap
prefix. To save time, we will restrict the anlysis to 33-36-year-olds and only
run 20 reps.

. bootstrap, reps(20): rqr ln_wage union if inrange(age,33,35),, quantile(.03(.02).97) controls(year c.grade##c.grade south i.ind_code)

When rqr is estimated using the bootstrap prefix, the default
in rqrplot is to plot the normal-approximation CIs.

. rqrplot

To get percentile-based CIs:

. rqrplot, bootstrap(percentile)

Stored results

rqr stores the following in r():

r(plotmat) matrix containing quantile, coefficient, standard
errors, and upper and lower confidence intervals

Version requirements

The rqrplot command requires Stata 12.0 or later.

Reference

Borgen, Haupt, and Wiborg (2021a)
A New Framework for Estimation of Unconditional Quantile Treatment Effects:
The Residualized Quantile Regression (RQR) Model. SocArXiv.
doi:10.31235/osf.io/42gcb

Borgen, Haupt, and Wiborg (2021b)
Flexible and fast estimation of quantile treatment effects: The rqr and rqrplot
commands SocArXiv. doi:10.31235/osf.io/4vquh

Authors

Nicolai T. Borgen, University of Oslo

n.t.borgen@isp.uio.no

Andreas Haupt, Karlsruhe Institute of Technology

andreas.haupt@kit.edu

Øyvind Wiborg, University of Oslo

o.n.wiborg@sosge.uio.no

Thanks for citing this software in one of the following ways:

Borgen, NT., A. Haupt, and ØN. Wiborg (2021).
A New Framework for Estimation of Unconditional Quantile Treatment Effects:
The Residualized Quantile Regression (RQR) Model. SocArXiv.
doi:10.31235/osf.io/42gcb

Borgen, Haput, and Wiborg (2021b)
Flexible and fast estimation of quantile treatment effects: The rqr and rqrplot
commands SocArXiv. doi:10.31235/osf.io/4vquh