bootCor: Bootstrap a correlation

Description Usage Arguments Details Value Author(s) References Examples

View source: R/bootCor.R

Description

Bootstrap the correlation of two numeric variables.

Usage

1
2
bootCor(x, y, 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.

conf.level

confidence level for the bootstrap ercentile interval.

B

number of times to resample (positive integer greater than 2).

plot.hist

a logical value. If TRUE, plot the bootstrap distribution of the resampled correlation.

hist.title

a user supplied title for the histogram.

plot.qq

a logical value. If TRUE a normal quantile-quantile plot of the bootstraped values is created.

legend.loc

location to place the legend. Options include "topright", "topleft", "bottomright", "bottomleft".

Details

Bootstrap the correlation of two numeric variables. The bootstrap mean and standard error are printed as well as a bootstrap percentile confidence interval.

Observations with missing values are removed.

Value

The command invisibly returns the correlations of the resampled observations.

Author(s)

Laura Chihara

References

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

Examples

1
2
plot(states03$ColGrad, states03$InfMortality)
bootCor(states03$ColGrad, states03$InfMortality)

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