如何通过基本自举置信区间和学生化自举区间计算 T.hat 的 95% 自举置信区间?
failtimes<-c(3, 5, 7, 18, 43, 85, 91, 98, 100, 130, 230, 487)
T.hat=length(failtimes)/sum(failtimes)
#Bootstrap estimate of bias
B <- 999
n <- length(failtimes)
T.b <- numeric(B)
for (b in 1:B) {
y <- sample(failtimes, size = n, replace = TRUE)
T.b[b] <- mean(y)
}
谢谢!