Skip to content
Prev 207067 / 398503 Next

Estimation of S.E. based on bootstrapping (functions with two or more arguments)

On 1/21/2010 7:45 AM, Tomas Zelinsky wrote:
How about using boot() in package boot?  Using your example:

 a <- c(1:10)
 b <- c(11:20)
DF <- data.frame(a,b)

library(boot)

boot(DF,
     statistic = function(d, ind){sum(d$a[ind])/sum(d$b[ind]*2)},
     R = 1000)

ORDINARY NONPARAMETRIC BOOTSTRAP

Call:
boot(data = DF, statistic = function(d, ind) {
    sum(d$a[ind])/sum(d$b[ind] * 2)
}, R = 1000)

Bootstrap Statistics :
     original       bias    std. error
t1* 0.1774194 -0.001594390  0.01902264