Description Usage Arguments Value References Examples
See Efron and Tibshirani (1993) for details on this function.
1 2 3 |
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 |
... |
any additional arguments to be passed to |
sdfun |
optional name of function for computing standard
deviation of |
nbootsd |
The number of bootstrap samples used to estimate the
standard deviation of |
nboott |
The number of bootstrap samples used to estimate the
distribution of the bootstrap T statistic.
200 is a bare minimum and 1000 or more is needed for
reliable α \% confidence points, α > .95 say.
Total number of bootstrap samples is
|
VS |
If |
v.nbootg |
The number of bootstrap samples used to estimate the
variance stabilizing transformation g.
Only used if |
v.nbootsd |
The number of bootstrap samples used to estimate the
standard deviation of |
v.nboott |
The number of bootstrap samples used to estimate the
distribution of
the bootstrap T statistic. Only used if |
perc |
Confidence points desired. |
list with the following components:
confpoints |
Estimated confidence points |
theta, g |
|
call |
The deparsed call |
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # 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=TRUE)
results$confpoints # gives confidence points
# plot the estimated var stabilizing transformation
plot(results$theta,results$g)
# 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)
|
0.001 0.01 0.025 0.05 0.1 0.5 0.9
[1,] 0.6600201 0.6942292 0.7867134 0.8929423 0.9552949 1.334063 1.875546
0.95 0.975 0.99 0.999
[1,] 2.099942 2.436077 2.589631 2.93073
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.