stat_cor_test | R Documentation |
Function to calculate Correlation coefficient and P-value between the columns of x and the columns of y, using one of Pearson's product moment correlation coefficient, Kendall's tau or Spearman's rho.
stat_cor_test(
x,
y = NULL,
use = c("pairwise.complete.obs", "everything", "all.obs", "complete.obs",
"na.or.complete"),
method = c("spearman", "pearson", "kendall"),
alternative = c("two.sided", "less", "greater"),
exact = TRUE,
cor_test = FALSE,
padj_method = "fdr",
...
)
x, y |
data.frame object. x and y must have the same |
use |
an optional character string giving a method for computing
covariances in the presence of missing values. This must be (an
abbreviation of) one of the strings |
method |
a character string indicating which correlation coefficient (or
covariance) is to be computed. One of |
alternative |
indicates the alternative hypothesis and must be one of
|
exact |
a logical indicating whether an exact p-value should be
computed. Used for Kendall's tau and Spearman's rho. See
|
cor_test |
a logical value indicates whether the estimation of P-value
should use |
padj_method |
See p.adjust |
... |
Other parameters passed to |
See cor.test
and cor
.
a tibble of the Correlation results. (see
cor.test
).
stat_cor_test(mtcars)
stat_cor_test(mtcars, cor_test = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.