Learn R Programming

npsm (version 2.0.0)

cor.boot.ci: Confidence interval for a correlation based on a bootstrap.

Description

Returns a bootstrap confidence interval for any of the correlations available in the base R cor function.

Usage

cor.boot.ci(x, y, method = "spearman", conf = 0.95, nbs = 3000)

Value

A confidence interval.

Arguments

x

n by 1 vector

y

n by 1 vector

method

Which correlation to use. Argument passed to cor.

conf

Confidence level.

nbs

number of bootstrap samples to base CI on.

Author

John Kloke, Joseph McKean

Details

Obtains a percentile bootstrap confidence interval. The bootstrap samples are obtained via the function boot.

See Also

See Also as cor

Examples

Run this code
library(boot)
with(bb2010,cor.boot.ci(ave,hr))

Run the code above in your browser using DataLab