# bootPaired: Bootstrap paired data In CarletonStats: Functions for Statistics Classes at Carleton College

## Description

Perform a bootstrap of two paired variables.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10``` ```bootPaired(x, ...) ## Default S3 method: bootPaired(x, y, conf.level = 0.95, B = 10000, plot.hist = TRUE, plot.qq = FALSE, legend.loc = "topright", x.name = deparse(substitute(x)), y.name = deparse(substitute(y)), ...) ## S3 method for class 'formula' bootPaired(formula, data, subset, ...) ```

## Arguments

 `x` a numeric vector. `...` further arguments to be passed to or from methods. `y` a numeric vector. `conf.level` confidence level for the bootstrap percentile interval. `B` number of resamples (positive integer greater than 2). `plot.hist` logical. If `TRUE`, plot the histogram of the bootstrap distribution. `plot.qq` logical. If `TRUE`, a normal quantile-quantile plot of the replicates will be created. `legend.loc` location for the legend on the histogram. Options are `"topright"` `"topleft"`, `"bottomleft"` and `"bottomright"`. `x.name` Label for variable x `y.name` Label for variable y `formula` a formula `y ~ x` where `x, y` are both numeric vectors `data` a data frame that contains the variables given in the formula. `subset` an optional expression indicating what observations to use.

## Details

The command will compute the difference of `x` and `y` and bootstrap the difference. The mean and standard error of the bootstrap distribution will be printed as well as a bootstrap percentile interval.

Observations with missing values are removed.

## Value

The command invisibly returns a vector with the replicates of the statistic being bootstrapped.

## Methods (by class)

• `default`: Perform a bootstrap of two paired variables.

• `formula`: Perform a bootstrap of two paired variables.

Laura Chihara

## References

Tim Hesterberg's website http://www.timhesterberg.net/bootstrap

## Examples

 ```1 2 3 4 5 6``` ```#Bootstrap the mean difference of fat content in vanilla and chocolate ice #cream. Data are paired becaues ice cream from the same manufacturer will #have similar content. Icecream bootPaired(ChocFat ~ VanillaFat, data = Icecream) bootPaired(Icecream\$VanillaFat, Icecream\$ChocFat) ```

CarletonStats documentation built on Aug. 10, 2018, 1:14 a.m.