使用R语言函数cor.test()做相关性计算和检验

转自:http://blog.sina.com.cn/s/blog_78c5f0530101btv3.html

具体看原文章

1 使用函数的说明

     这里进行主要使用R语言中的函数cor.test()函数进行相关性系数的计算和检验。

     函数功能:对成对数据进行相关性检验。里面有3中方法可供使用,分别是Pearson检验、Kendall检验和Spearman检验。

     函数的使用格式为:

       cor.test(x, y, alternative = c(“two.sided”, “less”, “greater”), method = c("pearson", "kendall", "spearman"),conf.level = 0.95)

其中x,y是供检验的样本;alternative指定是双侧检验还是单侧检验;method为检验的方法;conf.level为检验的置信水平。

猜你喜欢

转载自blog.csdn.net/weixin_43604756/article/details/89453533