"Percentile"<- function(x,nboot,theta,...,alpha = c(.025,.05,.1,.9,.95,.975)) { # Nonparametric percentile bootstrap conf. Int. # adapted from bcanon by Mai Zhou # no bias correction, no accelaration. Ref. book of Efron and Tibshirani call <- match.call() thetahat <- theta(x,...) bootsam <- t(matrix(sample(x,size=length(x)*nboot,replace=T),ncol=nboot)) thetastar <- apply(bootsam,1,theta,...) ooo <- trunc(alpha*nboot) # Can we improve trunc confpoints <- sort(thetastar)[ooo] # so that take linear interpolation confpoints <- cbind(alpha,confpoints) dimnames(confpoints)[[2]] <- c("alpha","%tile points") return(confpoints, call=call) }