slipper_ci: Bootstrap a function that returns a single number and return...

Usage Arguments

Usage

1
slipper_ci(df, expr, B = 100, lower = 0.025, upper = 0.975)

Arguments

df

A data frame

expr

A an expression with a function that operates on one or more variables from the data frame.

B

the number of bootstrap samples to draw

lower

the lower percentile for the confidence interval (default 2.5

\item

upperthe upper percentile for the confidence interval (default 97.5 confint A vector with the lower bound and upper bound Takes a data frame, a function that returns a single number, and a number of replicates and returns a data frame with the function calculated on the observed sample and on B bootstrap samples.

# Boostrap the mean of the mpg variable in the mtcars data set and get a confidence # interval slipper_ci(mtcars,mean(mpg),B=100)

# Bootstrap the mean of the mpg variable with piping mtcars %>% slipper_ci(mean(mpg),B=100)


jtleek/slipper documentation built on May 20, 2019, 3:14 a.m.