[R] bootstrap confidence intervals with previously existing bootstrap sample

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Sep 4 23:28:42 CEST 2007


On Tue, 4 Sep 2007, dolph008 at umn.edu wrote:

> Dear R users,
>
> I am new to R. I would like to calculate bootstrap confidence intervals
> using the BCa method for a parameter of interest. My situation is this: I
> already have a set of 1000 bootstrap replicates created from my original
> data set. I have already calculated the statistic of interest for each
> bootstrap replicate, and have also calculated the mean for this statistic
> across all the replicates. Now I would like to calculate Bca confidence
> intervals for this statistic. Is there a way to import my
> previously-calculated set of 1000 statistics into R, and then calculate
> bootstrap confidence intervals around the mean from this imported data?
>
> I have found the code for boot.ci in the manual for the boot package, but
> it looks like it requires that I first use the "boot" function, and then
> apply the output to "boot.ci". Because my bootstrap samples already exist,
> I don't want to use "boot", but just want to import the 1000 values I have
> already calculated, and then get R to calculate the mean and Bca confidence
> intervals based on these values. Is this possible?

Yes, it is possible but you will have to study the internal structure of 
an object of class "boot" (which is documented on the help page) and mimic 
it.  You haven't told us which type of bootstrap you used, which is one of 
the details you need to supply.

It might be slightly easier to work with function bcanon in package 
bootstrap, which you would need to edit to suit your purposes.

I don't know why you have picked on the BCa method: my experience is that 
if you need to correct the basic method you often need far more than 1000 
samples to get reliable results.

> Hopefully this makes sense. Thanks so much for any help or advice,
>
> Christy Dolph
>
> Graduate Student
> Water Resources Science
> University of Minnesota-Twin Cities

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list