tidyboot_mean {tidyboot}R Documentation

Non-parametric bootstrap and empirical central tendency for data frames Designed to make standard use of tidyboot.data.frame easier

Description

Computes arbitrary bootstrap statistics on univariate data. NOTE: Both empirical functions and bootstrapping functions will be computed over the grouping variables currently specified for the data frame.

Usage

tidyboot_mean(data, column, nboot = 1000, na.rm = FALSE)

Arguments

data

A data frame.

column

A column of data to bootstrap over.

nboot

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

na.rm

A logical value indicating whether NA values should be stripped before the computation proceeds.

Examples

## Mean and 95% confidence interval for 500 samples from two different normal distributions
require(dplyr)
gauss1 <- data_frame(value = rnorm(500, mean = 0, sd = 1), condition = 1)
gauss2 <- data_frame(value = rnorm(500, mean = 2, sd = 3), condition = 2)
df <- bind_rows(gauss1, gauss2)
df %>%
 group_by(condition) %>%
 tidyboot_mean(column = value)

[Package tidyboot version 0.1.1 Index]