

bootstrap(bootstrap)                         R Documentation

_N_o_n_-_P_a_r_a_m_e_t_r_i_c _B_o_o_t_s_t_r_a_p_p_i_n_g

_U_s_a_g_e_:

     bootstrap(x,nboot,theta,..., func=NULL)

_A_r_g_u_m_e_n_t_s_:

       x: a vector containing the data. To bootstrap more
          complex data structures (e.g. bivariate data) see
          the last example below.

   nboot: The number of bootstrap samples desired.

   theta: function to be bootstrapped. Takes `x' as an argu-
          ment, and may take additional arguments (see below
          and last example).

     ...: any additional arguments to be passed to `theta'

    func: (optional) argument specifying the functional the
          distribution of thetahat that is desired.  If func
          is specified, the jackknife after-bootstrap esti-
          mate of its standard error is also returned. See
          example below.

_V_a_l_u_e_:

     list with the following components:

thetastar: the `nboot' bootstrap values of `theta'

func.thetastar: the functional `func' of the bootstrap dis-
          tribution of thetastar, if `func' was specified

jack.boot.val: the jackknife-after-bootstrap values for
          `func', if `func' was specified

jack.boot.se: the jackknife-after-bootstrap standard error
          estimate of `func', if `func' was specified

_R_e_f_e_r_e_n_c_e_s_:

     Efron, B. and   Tibshirani, R. (1986).  The bootstrap
     method for standard errors, confidence intervals, and
     other measures of   statistical accuracy.  Statistical
     Science, Vol 1., No. 1, pp 1-35.

     Efron, B. (1992) Jackknife-after-bootstrap standard
     errors and influence functions. J. Roy. Stat. Soc. B,
     vol 54, pages 83-127

     Efron, B. and Tibshirani, R. (1993) An Introduction to
     the Bootstrap.  Chapman and Hall, New York, London.

_E_x_a_m_p_l_e_s_:

     # 100 bootstraps of the sample mean
     # (this is for illustration;  since "mean" is  a
     # built in function, bootstrap(x,100,mean) would be simpler!)
     x <- rnorm(20)
     theta <- function(x){mean(x)}

     results <- bootstrap(x,100,theta)

     # as above, but also estimate the 95th percentile
     # of the bootstrap dist'n of the mean, and
     # its jackknife-after-bootstrap  standard error

     perc95 <- function(x){quantile(x, .95)}

     results <-  bootstrap(x,100,theta, func=perc95)

     # To bootstrap functions of more complex data structures,
     # write theta so that its argument x
     #  is the set of observation numbers
     #  and simply  pass as data to bootstrap the vector 1,2,..n.
     # For example, to bootstrap
     # the correlation coefficient from a set of 15 data pairs:
     xdata <- matrix(rnorm(30),ncol=2)
     n <- 15
     theta <- function(x,xdata){ cor(xdata[x,1],xdata[x,2]) }
     results <- bootstrap(1:n,20,theta,xdata)

