| lprobust | R Documentation |
lprobust implements local polynomial regression point estimators, with robust bias-corrected confidence intervals and inference procedures developed in Calonico, Cattaneo and Farrell (2018). See also Calonico, Cattaneo and Farrell (2022) for related optimality results.
It also implements other estimation and inference procedures available in the literature.
Companion commands: lpbwselect for local polynomial data-driven bandwidth selection, and nprobust.plot for plotting results.
A detailed introduction to this command is given in Calonico, Cattaneo and Farrell (2019). For more details and related software useful for empirical analysis, visit https://nppackages.github.io/.
lprobust(y, x, eval = NULL, neval = NULL, p = NULL, deriv = NULL,
h = NULL, b = NULL, rho = 1, kernel = "epa", bwselect = NULL,
bwcheck = 21, bwregul = 1, imsegrid = 30, vce = "nn", covgrid = FALSE,
cluster = NULL, nnmatch = 3, level = 95, interior = FALSE, subset = NULL,
weights = NULL, masspoints = "check", data = NULL)
y |
dependent variable. |
x |
independent variable. |
eval |
vector of evaluation point(s). By default it uses 30 equally spaced points over the support of |
neval |
number of equally spaced evaluation points on the support of |
p |
polynomial order used to construct point estimator; default is |
deriv |
derivative order of the regression function to be estimated. Default is |
h |
main bandwidth used to construct local polynomial point estimator. Can be either scalar (same bandwidth for all evaluation points), or vector of same dimension as |
b |
bias bandwidth used to construct the bias-correction estimator. Can be either scalar (same bandwidth for all evaluation points), or vector of same dimension as |
rho |
Sets |
kernel |
kernel function used to construct local polynomial estimators. Options are |
bwselect |
bandwidth selection procedure to be used via
Use Note: MSE = Mean Square Error; IMSE = Integrated Mean Squared Error; CE = Coverage Error; DPI = Direct Plug-in; ROT = Rule-of-Thumb. For details on implementation see Calonico, Cattaneo and Farrell (2019). |
bwcheck |
if a positive integer is provided, then the selected bandwidth is enlarged so that at least |
bwregul |
specifies scaling factor for the regularization term added to the denominator of bandwidth selectors. Setting |
imsegrid |
number of evaluations points used to compute the IMSE bandwidth selector. Default is |
vce |
procedure used to compute the variance-covariance matrix estimator. Options are:
When |
covgrid |
if TRUE, it computes two covariance matrices (cov.us and cov.rb) for classical and robust covariances across point estimators over the grid of evaluation points. |
cluster |
indicates the cluster ID variable used for cluster-robust variance estimation. When supplied, the default |
nnmatch |
to be combined with for |
.
level |
confidence level used for confidence intervals; default is |
interior |
if TRUE, all evaluation points are assumed to be interior points. This option affects only data-driven bandwidth selection via |
subset |
optional rule specifying a subset of observations to be used. |
weights |
optional vector of non-negative observation weights of the same length as |
masspoints |
how to handle evaluation points whose bandwidth window contains few unique |
data |
an optional data frame. When supplied, |
Estimate |
A matrix containing |
cov.us |
Conventional-estimator covariance matrix across the evaluation grid ( |
cov.rb |
Robust-bias-corrected covariance matrix across the evaluation grid ( |
opt |
A list containing options passed to the function. |
Sebastian Calonico, University of California, Davis, CA. scalonico@ucdavis.edu.
Matias D. Cattaneo, Princeton University, Princeton, NJ. matias.d.cattaneo@gmail.com.
Max H. Farrell, University of California, Santa Barbara, CA. mhfarrell@gmail.com.
Calonico, S., M. D. Cattaneo, and M. H. Farrell. 2018. On the Effect of Bias Estimation on Coverage Accuracy in Nonparametric Inference. Journal of the American Statistical Association, 113(522): 767-779. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/01621459.2017.1285776")}.
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v091.i08")}.
Calonico, S., M. D. Cattaneo, and M. H. Farrell. 2022. Coverage Error Optimal Confidence Intervals for Local Polynomial Regression. Bernoulli, 28(4): 2998-3022.
lpbwselect
x <- runif(500)
y <- sin(4*x) + rnorm(500)
est <- lprobust(y,x)
summary(est)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.