Description Usage Arguments Value See Also Examples
Test for multiple associations between paired samples, using one of Pearson's product moment correlation coefficient, Kendall's tau or Spearman's rho.
1 2 3 4 5 6 7 8 9 |
x |
a numeric matrix or data frame. |
y |
NULL (default) or a matrix or data frame with compatible dimensions to x. The default is equivalent to y = x (but more efficient). |
use |
an optional character string giving a method for handling missing
values. This must be (an abbreviation of) one of the strings "everything",
"all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs"
(default). See |
method |
a character string indicating which correlation coefficient is to be computed. One of "pearson" (default), "kendall", or "spearman": can be abbreviated. |
boot_ci |
Logical value indicating whether or not to generate a
bootstrapped confidence interval for the correlation coefficient. Defaults
to |
p_adjust |
Character string naming the correction method to adjust for
multiple correlation tests. In addition to the standard available
|
... |
Optional named arguments accepted by |
a cor_test
object
cor.test
, cor_list
,
summarise.cor_list
, cor_boot
,
cor_perm
, p.adjust
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Create a correlation list for the numeric variables from the iris data set
cor_test(iris[,-5])
# Calculate a bootstrap confidence interval
cor_test(iris[,-5], boot_ci = TRUE, n_rep = 1000)
# Obtain unadjusted p-values with no correction for false discovery
cor_test(iris[,-5], p_adjust = "none")
# Use permutation test to adjust p-value for family-wise error
cor_test(iris[,-5], p_adjust = "permute", n_perm = 1000)
# Use Bonferroni correction to adjust p-value for family-wise error
cor_test(iris[,-5], p_adjust = "bonferroni")
#' Calculate spearman's rho
cor_test(iris[,-5], method = "spearman")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.