This functions constructs an object resembling one produced by the
boot
package's boot
function, and runs that package's
boot.ci
function to compute BCa and percentile confidence limits.
bootBCa
can provide separate confidence limits for a vector of
statistics when estimate
has length greater than 1. In that
case, estimates
must have the same number of columns as
estimate
has values.
bootBCa(estimate, estimates, type=c('percentile','bca','basic'),
n, seed, conf.int = 0.95)
original whole-sample estimate
vector of bootstrap estimates
type of confidence interval, defaulting to nonparametric percentile
original number of observations
.Random.seem
in effect before bootstrap estimates
were run
confidence level
a 2-vector if estimate
is of length 1, otherwise a matrix
with 2 rows and number of columns equal to the length of
estimate
# NOT RUN {
x1 <- runif(100); x2 <- runif(100); y <- sample(0:1, 100, TRUE)
f <- lrm(y ~ x1 + x2, x=TRUE, y=TRUE)
seed <- .Random.seed
b <- bootcov(f)
# Get estimated log odds at x1=.4, x2=.6
X <- cbind(c(1,1), x1=c(.4,2), x2=c(.6,3))
est <- X <!-- %*% coef(b) -->
ests <- t(X <!-- %*% t(b$boot.Coef)) -->
bootBCa(est, ests, n=100, seed=seed)
bootBCa(est, ests, type='bca', n=100, seed=seed)
bootBCa(est, ests, type='basic', n=100, seed=seed)
# }
Run the code above in your browser using DataLab