I am trying to calculate the confidence interval in R. Due to some special reasons, I have to do it with the functions in \"bootstrap\" package.(which means I can\'t use th
There are different ways of calculating the CI for the bootstrap estimator (cf. to this Wikipedia article for instance.
The easiest is to tale the 2.5%
and 97.5%
quantiles from the bootstrapped coefficients (Percentile Bootstrap in the Wikipedia article):
quantile(law.boot$thetastar, c(0.025, 0.975))
# 2.5% 97.5%
# 0.4528745 0.9454483
Basic Bootstrap would be calculated as
2 * mean(law.boot$thetastar) - quantile(law.boot$thetastar, c(0.975, 0.025))
# 97.5% 2.5%
# 0.5567887 1.0493625