tidyboot.numeric: Non-parametric bootstrap for numeric vector data

Description Usage Arguments Examples

View source: R/tidyboot.R

Description

Computes arbitrary bootstrap statistics on univariate data.

Usage

1
2
3
## S3 method for class 'numeric'
tidyboot(data, summary_function = mean,
  statistics_functions, nboot = 1000, size = 1, replace = TRUE, ...)

Arguments

data

A numeric vector of data to bootstrap over.

summary_function

A function to be computed over each set of samples. This function needs to take a vector and return a single number (defaults to mean).

statistics_functions

A named list of functions to be computed over the set of summary values from all samples.

nboot

The number of bootstrap samples to take (defaults to 1000).

size

The fraction of items to sample (defaults to 1).

replace

Logical indicating whether to sample with replacement (defaults to TRUE).

...

Other arguments passed from generic.

Examples

1
2
3
4
5
## Mean and 95% confidence interval for 500 samples from a normal distribution
x <- rnorm(500, mean = 0, sd = 1)
tidyboot(x, statistics_functions = list("ci_lower" = ci_lower,
                                        "mean" = mean,
                                        "ci_upper" = ci_upper))

tidyboot documentation built on May 2, 2019, 9:33 a.m.