Skip to contents

Bootstrap confidence intervals and p values

Usage

bootstrap_estimates(
  vals,
  grps,
  reference_arm = sort(unique(grps))[[1]],
  na_replacement = NULL,
  n_samples = 2000,
  alpha = 0.05
)

Arguments

vals

numeric vector

grps

character vector, allowed values are "ctrl" and "actv" and used to slice x into two vectors with values to be compared.

reference_arm

character vector of length 1, name of the reference arm in grps

na_replacement

scalar (or NULL), if NULL missing values will be removed. Otherwise, missing values will be replaced by the value of na_replacement

n_samples

single integer, number of bootstrap samples

alpha

numeric, 1.0 - confidence_level

Value

A four-element vector with point estimate, p value and confidence internal