bbcor {BBcor} | R Documentation |
Efficiently draws samples from the posterior distribution of various correlation coefficients
bbcor(x, method = "pearson", iter = 5000, cores = 2)
x |
A matrix of dimensions n by p |
method |
Character string. Which correlation coefficient should be computed. One of "pearson" (default), "kendall", "spearman", "gaussian_rank", or "blomqvist" (i.e., median correlation). |
iter |
Numeric. How many posterior samples (defaults to |
cores |
Numeric. How many cores for parallel computing (defaults to |
cor_mean
: A matrix including the posterior mean
samps
: An array of dimensions p
by b
by iter
that includes the
sampled correlation matrices.
NAs are removed.
Y <- mtcars[,1:2] bb_samps <- bbcor(Y, method = "spearman")