bootstrap | R Documentation |
Provide a numeric or character vector and create bootstrap samples
(with estimates) of the original vector. Also calculates CI95
using quantile()
.
bootstrap(x, boot = 1000, FUN, up = 0.975, lo = 0.025)
x |
Character or Numeric. The original data to be bootstrapped. |
boot |
Number of bootstraps to perform. |
FUN |
Function desired for the point estimate of the original data vector (if numeric data). Must return a scalar. |
up |
Upper confidence limit. |
lo |
Lower confidence limit. |
A list containing:
BootSamples |
List of the bootstrap populations created during the simulation. |
BootEstimates |
List of the various point estimates of each of the bootstrap samples. |
CI95 |
Vector of the point estimate and upper & lower CI95 produced via the bootstrap samples. |
SE |
The standard error based on the original data. Could be used to calculate CI95 via 1.96*SE if so desired. |
Stu Field
CI95se()
, quantile()
bootstrap(x = round(runif(25,1,100)), boot = 50, FUN = mean) # numeric bootstrap(x = LETTERS[1:26], boot = 50) # character z <- factor(sample(c("stu", "is", "cool"), 10, replace = TRUE)) # bootstrap(x = z, boot = 50) # factor (ask to convert to character)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.