R中的Bootstrap置信区间?

时间:2014-04-08 18:03:51

标签: r confidence-interval statistics-bootstrap

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

谢谢!

0 个答案:

没有答案