Description Usage Arguments Value Examples
Function of bootstrapping of correlation coefficients
1 |
x |
double vector. The observations of the first variable. |
y |
double vector. The observations of the second variable. |
n |
integer. The number of replicates. |
... |
further arguments to the function |
A vector of n
bootstrapping samples.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Sample some data
set.seed(123L)
x <- rnorm(50)
y <- x + rnorm(length(x))
cor(x, y)
## bootstrapping
bs <- bootstrap(x, y)
## bootstrap distribution
hist(bs)
## mean and standard-deviation of bootstrap distribution
c(mean(bs), sd(bs))
## two-sided 5% quantiles
quantile(x = bs, probs = c(0.025, 0.975))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.