home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / bootstrap / boott < prev    next >
Encoding:
Text File  |  1997-09-13  |  4.7 KB  |  118 lines

  1.     
  2.     _B_o_o_t_s_t_r_a_p-_t _c_o_n_f_i_d_e_n_c_e _l_i_m_i_t_s
  3.     
  4.          boott(x,theta, ..., sdfun=MISSING,nbootsd=25,nboott=200,
  5.            VS=F v.nbootg=100,v.nbootsd=25,v.nboott=200,
  6.               perc=c(.001,.01,.025,.05,.10,.50,.90,.95,.975,
  7.                   .99,.999))
  8.     
  9.     _A_r_g_u_m_e_n_t_s:
  10.     
  11.                 x: a vector containing the data. Nonparametric
  12.                    bootstrap sampling is used. To bootstrap from
  13.                    more complex data structures (e.g bivariate
  14.                    data) see the last example below.
  15.     
  16.             theta: function to be bootstrapped. Takes x as an
  17.                    argument, and may take additional arguments
  18.                    (see below and last example).
  19.     
  20.             sdfun: optional name of function for computing stan-
  21.                    dard deviation of theta based on data x.
  22.                    Should be of the form: sdmean <-
  23.                    function(x,nbootsd,theta,...) where nbootsd
  24.                    is a dummy argument that is not used. If
  25.                    theta is the mean, for example, sdmean <-
  26.                    function(x,nbootsd,theta,...)
  27.                    sqrt(var(x)/length(x)).  If sdfun is missing,
  28.                    then boott uses an inner bootstrap loop to
  29.                    estimate the standard deviation of theta(x)
  30.     
  31.           nbootsd: The number of bootstrap samples used to esti-
  32.                    mate the standard deviation of theta(x)
  33.     
  34.            nboott: The number of bootstrap samples used to esti-
  35.                    mate the distribution of the bootstrap T
  36.                    statistic.  200 is a bare minimum and 1000 or
  37.                    more is needed for reliable  alpha % confi-
  38.                    dence points, alpha > .95 say. Total number
  39.                    of bootstrap samples is nboott*nbootsd.
  40.     
  41.                VS: If true, a variance stabilizing transforma-
  42.                    tion is estimated, and the interval is con-
  43.                    structed on the transformed scale, and then
  44.                    is mapped back to the original theta scale.
  45.                    This can improve both the statistical proper-
  46.                    ties of the intervals and speed up the compu-
  47.                    tation. See the reference Tibshirani (1988)
  48.                    given below.  If false,  variance stabiliza-
  49.                    tion is not performed.
  50.     
  51.          v.nbootg: The number of bootstrap samples used to esti-
  52.                    mate the variance stabilizing transformation
  53.                    g.  Only used if VS=T.
  54.     
  55.         v.nbootsd: The number of bootstrap samples used to esti-
  56.                    mate the standard deviation of theta(x).
  57.                    Only used if VS=T.
  58.     
  59.          v.nboott: The number of bootstrap samples used to esti-
  60.                    mate the distribution of the bootstrap T
  61.                    statistic. Only used if VS=T. Total number of
  62.                    bootstrap samples is v.nbootg*v.nbootsd +
  63.                    v.nboott
  64.     
  65.              perc: Confidence points desired.
  66.     
  67.     _V_a_l_u_e_s:
  68.     
  69.          list with the following components:
  70.     
  71.     confpoints: Estimated confidence points
  72.     
  73.     theta, g: theta and g are only returned if VS=T was speci-
  74.               fied. (theta[i],g[i]),  i=1,length(theta)
  75.               represents the estimate of the variance stabiliz-
  76.               ing transformation g at the points theta[i].
  77.     
  78.     _R_e_f_e_r_e_n_c_e_s:
  79.     
  80.          Tibshirani, R. (1988) "Variance stabilization and the
  81.          bootstrap". Biometrika (1988) vol 75 no 3 pages 433-44.
  82.     
  83.          Hall, P. (1988) Theoretical comparison of bootstrap
  84.          confidence intervals. Ann. Statisi. 16, 1-50.
  85.     
  86.          Efron, B. and Tibshirani, R. (1993) An Introduction to
  87.          the Bootstrap.  Chapman and Hall, New York, London.
  88.     
  89.     _E_x_a_m_p_l_e_s:
  90.     
  91.          #  estimated confidence points for the mean
  92.          x <- rchisq(20,1)
  93.          theta <- function(x)mean(x)
  94.          results <- boott(x,theta)
  95.          # estimated confidence points for the mean,
  96.          #  using variance-stabilization bootstrap-T method
  97.          results <-  boott(x,theta,VS=T)
  98.          resultsonfpoints          # gives confidence points
  99.          # plot the estimated var stabilizing transformation
  100.          plot(resultsheta,results)
  101.          # use standard formula for stand dev of mean
  102.          # rather than an inner bootstrap loop
  103.          sdmean <- function(x)
  104.              sqrt(var(x)/length(x))
  105.          results <-  boott(x,theta,sdfun=sdmean)
  106.     
  107.          # To bootstrap functions of more  complex data structures,
  108.          # write theta so that its argument x
  109.          #  is the set of observation numbers
  110.          #  and simply  pass as data to boot the vector 1,2,..n.
  111.          # For example, to bootstrap
  112.          # the correlation coefficient from a set of 15 data pairs:
  113.          xdata <- matrix(rnorm(30),ncol=2)
  114.          n <- 15
  115.          theta <- function(x, xdata) cor(xdata[x,1],xdata[x,2])
  116.          results <- boott(1:n,theta, xdata)
  117.     
  118.