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

View source: R/cor.boot.ci.r

cor.boot.ciR Documentation

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)

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.

Details

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

Value

A confidence interval.

Author(s)

John Kloke, Joseph McKean

See Also

See Also as cor

Examples

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

npsm documentation built on Nov. 15, 2023, 1:08 a.m.