home *** CD-ROM | disk | FTP | other *** search
-
- _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
-
- boott(x,theta, ..., sdfun=MISSING,nbootsd=25,nboott=200,
- VS=F v.nbootg=100,v.nbootsd=25,v.nboott=200,
- perc=c(.001,.01,.025,.05,.10,.50,.90,.95,.975,
- .99,.999))
-
- _A_r_g_u_m_e_n_t_s:
-
- x: a vector containing the data. Nonparametric
- bootstrap sampling is used. To bootstrap from
- more complex data structures (e.g bivariate
- data) see the last example below.
-
- theta: function to be bootstrapped. Takes x as an
- argument, and may take additional arguments
- (see below and last example).
-
- sdfun: optional name of function for computing stan-
- dard deviation of theta based on data x.
- Should be of the form: sdmean <-
- function(x,nbootsd,theta,...) where nbootsd
- is a dummy argument that is not used. If
- theta is the mean, for example, sdmean <-
- function(x,nbootsd,theta,...)
- sqrt(var(x)/length(x)). If sdfun is missing,
- then boott uses an inner bootstrap loop to
- estimate the standard deviation of theta(x)
-
- nbootsd: The number of bootstrap samples used to esti-
- mate the standard deviation of theta(x)
-
- nboott: The number of bootstrap samples used to esti-
- mate the distribution of the bootstrap T
- statistic. 200 is a bare minimum and 1000 or
- more is needed for reliable alpha % confi-
- dence points, alpha > .95 say. Total number
- of bootstrap samples is nboott*nbootsd.
-
- VS: If true, a variance stabilizing transforma-
- tion is estimated, and the interval is con-
- structed on the transformed scale, and then
- is mapped back to the original theta scale.
- This can improve both the statistical proper-
- ties of the intervals and speed up the compu-
- tation. See the reference Tibshirani (1988)
- given below. If false, variance stabiliza-
- tion is not performed.
-
- v.nbootg: The number of bootstrap samples used to esti-
- mate the variance stabilizing transformation
- g. Only used if VS=T.
-
- v.nbootsd: The number of bootstrap samples used to esti-
- mate the standard deviation of theta(x).
- Only used if VS=T.
-
- v.nboott: The number of bootstrap samples used to esti-
- mate the distribution of the bootstrap T
- statistic. Only used if VS=T. Total number of
- bootstrap samples is v.nbootg*v.nbootsd +
- v.nboott
-
- perc: Confidence points desired.
-
- _V_a_l_u_e_s:
-
- list with the following components:
-
- confpoints: Estimated confidence points
-
- theta, g: theta and g are only returned if VS=T was speci-
- fied. (theta[i],g[i]), i=1,length(theta)
- represents the estimate of the variance stabiliz-
- ing transformation g at the points theta[i].
-
- _R_e_f_e_r_e_n_c_e_s:
-
- Tibshirani, R. (1988) "Variance stabilization and the
- bootstrap". Biometrika (1988) vol 75 no 3 pages 433-44.
-
- Hall, P. (1988) Theoretical comparison of bootstrap
- confidence intervals. Ann. Statisi. 16, 1-50.
-
- 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:
-
- # estimated confidence points for the mean
- x <- rchisq(20,1)
- theta <- function(x)mean(x)
- results <- boott(x,theta)
- # estimated confidence points for the mean,
- # using variance-stabilization bootstrap-T method
- results <- boott(x,theta,VS=T)
- resultsonfpoints # gives confidence points
- # plot the estimated var stabilizing transformation
- plot(resultsheta,results)
- # use standard formula for stand dev of mean
- # rather than an inner bootstrap loop
- sdmean <- function(x)
- sqrt(var(x)/length(x))
- results <- boott(x,theta,sdfun=sdmean)
-
- # 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 boot 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 <- boott(1:n,theta, xdata)
-
-