后来我在cos统计之都上找到了答案,现在贴出来供大家分享和讨论:
> library(boot)#当然要先下载安装boot包
> set.seed(200)
> x=c(5,4,9,6,21,17,11,20,7,10,21,15,13,16,8)
> x.boot <- boot(x,function(x,i)var(x[i]),R=999)
> x.boot
ORDINARY NONPARAMETRIC BOOTSTRAP
Call:
boot(data = x, statistic = function(x, i) var(x[i]), R = 999)
Bootstrap Statistics :
original bias std. error
t1* 34.31429 -2.203737 7.32227
大家看到了std.error 下面对应的7.32227吗
var(x)的bootstrap估计就是7.32227的平方 53.61564
|