View source: R/lpdensity_methods.R
confint.lpdensity | R Documentation |
The confint method for local polynomial density objects.
## S3 method for class 'lpdensity'
confint(object, parm = NULL, level = NULL, ...)
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) |
A matrix containing grid points and confidence interval end points using p- and q-th order local polynomials.
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.
lpdensity
for local polynomial density estimation.
Supported methods: coef.lpdensity
, confint.lpdensity
,
plot.lpdensity
, print.lpdensity
, summary.lpdensity
,
vcov.lpdensity
.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.