使用boot.ci命令计算某些数据的均值的bootstrap置信区间时,我收到错误。在同一数据集中,它适用于某些数据而不适用于其他数据。
my.mean = function(x, indices) {
return( mean( x[indices] ) ) }
pakkeSTdependents.boot = boot(pakkeST$B4..Dependents, my.mean, 10000)
boot.ci(pakkeSTdependents.boot, conf=0.95)
my.mean = function(x, indices) {
return( mean( x[indices] ) ) }
pakkenonSTdependents.boot = boot(pakkenonST$B4..Dependents, my.mean, 10000)
boot.ci(pakkenonSTdependents.boot, conf=0.95)
my.mean = function(x, indices) {
+return( mean( x[indices] ) ) }
pakkeSTdependents.boot = boot(pakkeST$B4..Dependents, my.mean, 10000)
boot.ci(pakkeSTdependents.boot, conf=0.95)
我得到以下输出
Error in bca.ci(boot.out, conf, index[1L], L = L, t = t.o, t0 = t0.o,:
estimated adjustment 'w' is infinite
In addition: Warning message:
In boot.ci(pakkeSTdependents.boot, conf = 0.95) :
bootstrap variances needed for studentized intervals
my.mean = function(x, indices) {
+ return( mean( x[indices] ) ) }
pakkenonSTdependents.boot =boot(pakkenonST$B4..Dependents,my.mean,10000)
boot.ci(pakkenonSTdependents.boot, conf=0.95)
BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
Based on 10000 bootstrap replicates
CALL :
boot.ci(boot.out = pakkenonSTdependents.boot, conf = 0.95)
Intervals :
Level Normal Basic
95% ( 2.558, 4.231 ) ( 2.600, 4.200 )
Level Percentile BCa
95% ( 2.6, 4.2 ) ( 2.4, 4.1 )
Calculations and Intervals on Original Scale`