[R] boot.ci error with large data sets
Lars Dalby
lars.dalby at gmail.com
Wed Feb 16 13:44:21 CET 2011
Dear List
I have run into some problems with boot.ci from package boot. When I
try to obtain a confidence interval of type bca, boot.ci() returns the
following error when the data set i large:
Error in bca.ci(boot.out, conf, index[1L], L = L, t = t.o, t0 =
t0.o, :
estimated adjustment 'a' is NA
Below is an example that produces the above mentioned error on my
machine.
library(boot)
#The wrapper function:
w.mean <- function(x, d) {
E <- x[d,]
return(weighted.mean(E$A, E$B))}
#Some fake data:
test <- data.frame(rnorm(1000, 5), rnorm(1000, 3))
test1 <- data.frame(rnorm(10000, 5), rnorm(10000, 3))
names(test) <- c("A", "B")
names(test1) <- c("A", "B")
# Getting the boot object and the CI, seem to works fine
bootout <- boot(test, w.mean, R=1000, stype="i")
(bootci <- boot.ci(bootout, conf = 0.95, type = "bca"))
# Now with a bigger data set, boot.ci returns an error.
bootout1 <- boot(test1, w.mean, R=1000, stype="i")
(bootci1 <- boot.ci(bootout1, conf = 0.95, type = "bca"))
Does anyone have an idea as to why this happens? (Session info below)
Best,
Lars
> sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] da_DK.UTF-8/da_DK.UTF-8/C/C/da_DK.UTF-8/da_DK.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods
base
other attached packages:
[1] boot_1.2-43
loaded via a namespace (and not attached):
[1] tools_2.12.1
More information about the R-help
mailing list