如何通过基本引导置信区间和学生化引导区间计算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)
}
谢谢!