cor(x, y = NULL, use = “everything”,
method = c(“pearson”, “kendall”, “spearman”))
use:一种可选的字符串,提供了一种在缺少值时计算协方差的方法。这必须是字符串“everything”、“all.obs”, “complete.obs”, “na.or.complete”, or "pairwise.complete.obs"中的一个(缩写)。
cor.test(x, y,
alternative = c(“two.sided”, “less”, “greater”),
method = c(“pearson”, “kendall”, “spearman”),
exact = NULL, conf.level = 0.95, continuity = FALSE, …)
利用皮尔逊积矩相关系数、肯德尔tau或斯皮尔曼rho对配对样本之间的相关性进行检验。
alternative :表示可选假设,必须是"two.sided", “greater” or "less"中的一个。可以只指定初始字母。“大”对应积极联想,“小”对应消极联想
corr.test(x, y = NULL, use = “pairwise”,method=“pearson”,adjust=“holm”,
alpha=.05,ci=TRUE,minlength=5)
corr.p(r,n,adjust=“holm”,alpha=.05,minlength=5)
虽然cor函数查找矩阵的相关性,但它不报告概率值。test可以,但是一次只对一对变量。corr.test使用cor来查找完整或成对数据的相关性,并报告样本大小和概率值。对于对称矩阵,原始概率报告在对角线以下,相关性调整为对角线以上的多次比较。对于不同的x和y,默认情况是调整多个测试的概率。corr.test和corr.p都返回原始和调整后的con