nprobust
Package.nprobust.plot
plots estimated density and regression function using the nprobust
package. A detailed introduction to this command is given in Calonico, Cattaneo and Farrell (2019).
Companion commands: lprobust
for local polynomial point estimation and inference procedures, and kdrobust
for kernel density point estimation and inference procedures.
For more details, and related Stata and R packages useful for empirical analysis, visit https://nppackages.github.io/.
nprobust.plot(..., alpha = NULL, type = NULL, CItype = NULL,
title = "", xlabel = "", ylabel = "", lty = NULL, lwd = NULL,
lcol = NULL, pty = NULL, pwd = NULL, pcol = NULL, CIshade = NULL,
CIcol = NULL, legendTitle = NULL, legendGroups = NULL)
A standard ggplot2
object is returned, hence can be used for further customization.
Objects returned by kdrobust
or lprobust
.
Numeric scalar between 0 and 1, the significance level for plotting confidence regions. If more than one is provided, they will be applied to data series accordingly.
String, one of "line"
(default), "points"
or "both"
, how
the point estimates are plotted. If more than one is provided, they will be applied to data series
accordingly.
String, one of "region"
(shaded region, default), "line"
(dashed lines),
"ebar"
(error bars), "all"
(all of the previous) or "none"
(no confidence region),
how the confidence region should be plotted. If more than one is provided, they will be applied to data series
accordingly.
Strings, title of the plot and labels for x- and y-axis.
Line type for point estimates, only effective if type
is "line"
or
"both"
. 1
for solid line, 2
for dashed line, 3
for dotted line.
For other options, see the instructions for ggplot2
or par
. If
more than one is provided, they will be applied to data series accordingly.
Line width for point estimates, only effective if type
is "line"
or
"both"
. Should be strictly positive. For other options, see the instructions for
ggplot2
or par
. If more than one is provided, they will be applied
to data series accordingly.
Line color for point estimates, only effective if type
is "line"
or
"both"
. 1
for black, 2
for red, 3
for green, 4
for blue.
For other options, see the instructions for ggplot2
or par
. If
more than one is provided, they will be applied to data series
accordingly.
Scatter plot type for point estimates, only effective if type
is "points"
or
"both"
. For options, see the instructions for ggplot2
or par
. If
more than one is provided, they will be applied to data series
accordingly.
Scatter plot size for point estimates, only effective if type
is "points"
or
"both"
. Should be strictly positive. If more than one is provided, they will be applied to data series
accordingly.
Scatter plot color for point estimates, only effective if type
is "points"
or
"both"
. 1
for black, 2
for red, 3
for green, 4
for blue.
For other options, see the instructions for ggplot2
or par
. If
more than one is provided, they will be applied to data series
accordingly.
Numeric, opaqueness of the confidence region, should be between 0 (transparent) and 1. Default is 0.2. If more than one is provided, they will be applied to data series accordingly.
color for confidence region. 1
for black, 2
for red, 3
for green, 4
for blue.
For other options, see the instructions for ggplot2
or par
. If
more than one is provided, they will be applied to data series
accordingly.
String, title of legend.
String Vector, group names used in legend.
Sebastian Calonico, Columbia University, New York, NY. sebastian.calonico@columbia.edu.
Matias D. Cattaneo, Princeton University, Princeton, NJ. cattaneo@princeton.edu.
Max H. Farrell, University of Chicago, Chicago, IL. max.farrell@chicagobooth.edu.
Companion command: lprobust
for local polynomial-based regression functions and derivatives estimation.
Calonico, S., M. D. Cattaneo, and M. H. Farrell. 2019. nprobust: Nonparametric Kernel-Based Estimation and Robust Bias-Corrected Inference. Journal of Statistical Software, 91(8): 1-33. tools:::Rd_expr_doi("http://dx.doi.org/10.18637/jss.v091.i08").
lprobust
, kdrobust
, ggplot2
x <- runif(500)
y <- sin(4*x) + rnorm(500)
est <- lprobust(y,x)
nprobust.plot(est)
Run the code above in your browser using DataLab