tidyboot_mean: Non-parametric bootstrap and empirical central tendency for...

Description Usage Arguments Examples

View source: R/tidyboot.R

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

1
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

1
2
3
4
5
6
7
8
## 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)

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