bootPaired: Bootstrap paired data

Description Usage Arguments Details Value Author(s) References Examples

View source: R/bootPaired.R

Description

Perform a bootstrap of two paired variables.

Usage

1
2
bootPaired(x, y, fun = mean, conf.level = 0.95, B = 10000, plot.hist = TRUE, 
     hist.title = NULL, plot.qq = FALSE, legend.loc = "topright")

Arguments

x

a numeric vector.

y

a numeric vector.

fun

function for the statistic you wish to compute.

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.

hist.title

supply your own title for the histogram.

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".

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.

Author(s)

Laura Chihara

References

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

Examples

1
2
3
4
5
6
7
#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(Icecream$VanillaFat, Icecream$ChocFat)

 

CarletonStats documentation built on May 29, 2017, 11:20 p.m.