ci_mean_boot: Basic nonparametric bootstrap confidence interval of mean

Description Usage Arguments Details Value Examples

View source: R/ci_mean_boot.R

Description

A very fast implementation of the basic nonparametric bootstrap for obtaining confidence limits for the population mean without assuming normality.

Usage

1
2
3
4
5
6
7
8
ci_mean_boot(
  y,
  conf_level = 0.95,
  repetitions = 2000,
  na.rm = TRUE,
  resampled_means = FALSE,
  return_df = TRUE
)

Arguments

y

(numeric) A numeric vector from which NAs will be removed automatically.

conf_level

(number) Confidence level. Number from 0 to 1. Default 0.95.

repetitions

(integer) Number of bootstrap resamples.

na.rm

(logical) If TRUE (default), missing values (NA's) are removed automatically.

resampled_means

(logical) If TRUE, the vector of bootstrapped means will be returned as the resampled_means attribute of the returned object.

return_df

(logical) If TRUE (default), result is returned as a data frame. If FALSE - as a matrix.

Details

The function is based on code of function Hmisc::smean.cl.boot() from package Hmisc.

Value

An object (data frame or matrix) with a point estimate and confidence interval of mean.

Examples

1
2
3
4
5
6
set.seed(111555)
ci_mean_boot(1:60)

set.seed(999555)
y <- rnorm(35, 10, 5)
ci_mean_boot(y)

GegznaV/BioStat documentation built on Aug. 14, 2020, 9:30 p.m.