confint.lpdensity {lpdensity} | R Documentation |
Confint Method for Local Polynomial Density Estimation and Inference
Description
The confint method for local polynomial density objects.
Usage
## S3 method for class 'lpdensity'
confint(object, parm = NULL, level = NULL, ...)
Arguments
object |
Class "lpdensity" object, obtained by calling |
parm |
Integer, indicating which parameters are to be given confidence intervals. |
level |
Numeric scalar between 0 and 1, the significance level for computing confidence intervals |
... |
Additional options, including (i) |
Value
A matrix containing grid points and confidence interval end points using p- and q-th order local polynomials.
Author(s)
Matias D. Cattaneo, Princeton University. cattaneo@princeton.edu.
Michael Jansson, University of California Berkeley. mjansson@econ.berkeley.edu.
Xinwei Ma (maintainer), University of California San Diego. x1ma@ucsd.edu.
See Also
lpdensity
for local polynomial density estimation.
Supported methods: coef.lpdensity
, confint.lpdensity
,
plot.lpdensity
, print.lpdensity
, summary.lpdensity
,
vcov.lpdensity
.
Examples
# Generate a random sample
set.seed(42); X <- rnorm(2000)
# Estimate density and report 95% confidence intervals
est1 <- lpdensity(data = X, bwselect = "imse-dpi")
confint(est1)
# Report results for a subset of grid points
confint(est1, parm=est1$Estimate[4:10, "grid"])
confint(est1, grid=est1$Estimate[4:10, "grid"])
confint(est1, gridIndex=4:10)
# Report the 99% uniform confidence band
# Fix the seed for simulating critical values
set.seed(42); confint(est1, level=0.99, CIuniform=TRUE)
set.seed(42); confint(est1, alpha=0.01, CIuniform=TRUE)