cor_tab | R Documentation |
Calculate correlation coefficient and p-values.
cor_tab(
x,
cor.method = c("pearson", "kendall", "spearman"),
adj.method = c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none"),
...
)
x |
a data frame or matrix for correlation analysis column-wise. |
cor.method |
method for correlation |
adj.method |
p-value correction method |
... |
other parameter for correlation. |
This file is modified from cor.table
of package picante
and corr.test
of package psych
.
The original implementation is from Bill Venables, the author of R great
book MASS. For details, see
https://stat.ethz.ch/pipermail/r-help/2001-November/016201.html
a list with contents:
r correlation coefficient
p statistics matrix, in which the lower triangular is p-values and the upper triangular is adjusted p-values
co <- cor_tab(mtcars, cor.method = "spearman", adj.method = "BH")
names(co)
## Not run:
library(pysch)
co <- corr.test(mtcars, method="spearman",adjust="BH")
# From pysch: For symmetric matrices, p values adjusted for multiple tests
# are reported above the diagonal.
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.