5

我是新的 R 用户,在使用引导包时遇到问题。我想要做的就是使用自举生成围绕数字向量均值的置信区间,例如:

x <- rnorm(100, 1, .5)

有小费吗?

4

1 回答 1

12

以下内容还不够吗?

library(boot)
x <- rnorm(100, 1, .5)
b <- boot(x, function(u,i) mean(u[i]), R = 999)
boot.ci(b, type = c("norm", "basic", "perc"))
于 2012-02-16T02:41:23.553 回答