[R] bootstrap

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Feb 19 15:17:50 CET 2005


On Sat, 19 Feb 2005, j h wrote:

> Please, can you help me with a problem concerning bootstrap. I have a 
> 20000 by 20 matrix. I want to define each row as a variable. Then using 
> bootstrap to calculate standard errors, confidence intervals, and 
> significance tests. How can I do from defining the variables to 
> bootstrap analysis..

You want to have 20 variables with 20,000 values each (suspiciously round 
numbers -- is this a real problem or a student exercise?)

mydf <- as.data.frame(t(mymatrix))  # normal to have columns as variables.

library(boot)
?boot

Now, what statistic do you want to bootstrap?  You have not told us!
Nor what parameter you want confidence intervals for
nor what [null] hypothesis you want a significance test for.

I can strongly recommend Davison & Hinkley's book, for which package boot 
is the support software.  It seems your problems are about statistical 
concepts, not R software, but that book covers both.

-- 
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