# BootCI: Simple Bootstrap Confidence Intervals In AndriSignorell/DescTools: Tools for Descriptive Statistics

## Description

Convenience wrapper for calculating bootstrap confidence intervals for univariate and bivariate statistics.

## Usage

 ```1 2``` ```BootCI(x, y = NULL, FUN, ..., bci.method = c("norm", "basic", "stud", "perc", "bca"), conf.level = 0.95, sides = c("two.sided", "left", "right"), R = 999) ```

## Arguments

 `x` a (non-empty) numeric vector of data values. `y` NULL (default) or a vector with compatible dimensions to `x`, when a bivariate statistic is used. `FUN` the function to be used `bci.method` A vector of character strings representing the type of intervals required. The value should be any subset of the values `"norm"`, `"basic"`, `"stud"`, `"perc"`, `"bca"`, as it is passed on as `method` to `boot.ci`. `conf.level` confidence level of the interval. `sides` a character string specifying the side of the confidence interval, must be one of `"two.sided"` (default), `"left"` or `"right"`. You can specify just the initial letter. `"left"` would be analogue to a hypothesis of `"greater"` in a `t.test`. `...` further arguments are passed to the function `FUN`. `R` The number of bootstrap replicates. Usually this will be a single positive integer. For importance resampling, some resamples may use one set of weights and others use a different set of weights. In this case `R` would be a vector of integers where each component gives the number of resamples from each of the rows of weights.

## Value

a named numeric vector with 3 elements:

 `` the specific estimate, as calculated by `FUN` `lwr.ci` lower bound of the confidence interval `upr.ci` upper bound of the confidence interval

## Author(s)

Andri Signorell <andri@signorell.net>

## See Also

`MeanCI`, `MedianCI`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10``` ```set.seed(1984) BootCI(d.pizza\$temperature, FUN=mean, na.rm=TRUE, bci.method="basic") BootCI(d.pizza\$temperature, FUN=mean, trim=0.1, na.rm=TRUE, bci.method="basic") BootCI(d.pizza\$temperature, FUN=Skew, na.rm=TRUE, bci.method="basic") BootCI(d.pizza\$operator, d.pizza\$area, FUN=CramerV) spearman <- function(x,y) cor(x, y, method="spearman", use="p") BootCI(d.pizza\$temperature, d.pizza\$delivery_min, FUN=spearman) ```

AndriSignorell/DescTools documentation built on April 8, 2021, 5:51 a.m.
{"ft_lang_label":"__label__en","ft_lang_prob":0.60191697,"math_prob":0.9458978,"size":1644,"snap":"2021-04-2021-17","text_gpt3_token_len":441,"char_repetition_ratio":0.116463415,"word_repetition_ratio":0.016949153,"special_character_ratio":0.24209246,"punctuation_ratio":0.16975309,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98875064,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-04-15T02:08:01Z\",\"WARC-Record-ID\":\"<urn:uuid:3802682c-6b00-484c-97e3-529bf467e9a4>\",\"Content-Length\":\"57340\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7657c338-deee-4a53-b785-aed639d23bbf>\",\"WARC-Concurrent-To\":\"<urn:uuid:bf74682d-9ff3-4fa2-bac7-3e149fca84eb>\",\"WARC-IP-Address\":\"51.81.83.12\",\"WARC-Target-URI\":\"https://rdrr.io/github/AndriSignorell/DescTools/man/BootCI.html\",\"WARC-Payload-Digest\":\"sha1:KNVKXWZWABPLJFOHYIO756FEPBEGDVF5\",\"WARC-Block-Digest\":\"sha1:OEW46YQWENZJSGKMXPWTE4GWPSXK4J32\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-17/CC-MAIN-2021-17_segments_1618038082988.39_warc_CC-MAIN-20210415005811-20210415035811-00094.warc.gz\"}"}