cor.conf: Confidence Functions for Pearson's Correlation Coefficient

Description Usage Arguments Value References Examples

View source: R/cor.R

Description

Confidence functions for Pearson's correlation coefficient for a bivariate Gaussian.

Usage

1
cor.conf(x, y, plot = TRUE, conf.level = 0.95, exact = FALSE)

Arguments

x

a numeric vector

y

a numeric vector

plot

whether to plot the confidence density and curve

conf.level

the confidence level for the confidence interval indicated on the confidence curve

exact

whether the exact sampling distribution of the sample correlation coefficient (TRUE) or Fisher's Z-transformation (FALSE) should be used in constructing the confidence functions.

Value

A list containing the confidence functions pconf, dconf, cconf, and qconf for Pearson's correlation coefficient for a bivariate Gaussian, as well as the P-curve and S-curve.

References

Tore Schweder and Nils Lid Hjort. Confidence, likelihood, probability. Vol. 41. Cambridge University Press, 2016.

Bradley Efron and Trevor Hastie. Computer Age Statistical Inference. Vol. 5. Cambridge University Press, 2016.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(fat)

fat <- fat[1:50, ] # Smaller sub-sample, to show exact versus
                   # Fisher's Z-transformation.

# Using the exact sampling distribution of R
cor.conf(x = fat$body.fat, y = fat$weight, exact = TRUE)

# Using Fisher's Z-transformation (to match cor.test())
cor.conf(x = fat$body.fat, y = fat$weight, exact = FALSE)

ddarmon/clp documentation built on Jan. 25, 2021, 6:22 p.m.