Skip to contents

Uses the 1/n covariance and the 1/n standard deviations, so the divisors cancel and r matches the book's deviation form.

Usage

SampR(x, y)

Arguments

x, y

equal-length data vectors, n >= 2, neither constant.

Value

list(r, cov).

References

Morin, D. J. (2016). Probability: For the Enthusiastic Beginner. Createspace. Eqs (6.12), (6.55).

Examples

SampR(c(2, 3, 3, 5, 7), c(1, 1, 3, 4, 6))$r
#> [1] 0.942809