1
votes

I want to calculate the 90% Confidence interval (Bootstrap) for these two estimations. Harrell-Davis Distribution-Free Quantile Estimator. I think this function is the bootstrapped version of the nonparametric quantile which estimate the mean and standard deviations. Now I was wondering how I can calculate the 90% CI?

library(Hmisc)
x <- runif(100)
hdquantile(x, probs =  seq(0.025, 0.975,0.95), se=TRUE,names = TRUE, weights=FALSE)
1

1 Answers

0
votes

The hdquantile function computes the estimator and also gives the standard error if you set se=TRUE. To find the confidence interval you can bootstrap it through boot function and get confidence intervals through boot.ci

Code

library(Hmisc)
x <- runif(100)
hdquantile(x, probs =  seq(0.025, 0.975,0.95), se=TRUE,names = TRUE, 
weights=FALSE)

For booting create a statistic

library(boot)
hq <- function(x,i) {
hdquantile(x[i], probs =  seq(0.025, 0.975,0.95), se=TRUE,names = TRUE, 
weights=FALSE)
}
bootx <- boot(x,hq,1000)
boot.ci(bootx, conf = 0.90)