使用R计算相关系数
来源:互联网 发布:自学武术软件 编辑:程序博客网 时间:2024/06/05 10:44
http://zoonek2.free.fr/UNIX/48_R/09.html
使用R计算相关系数的函数为:
cor.test(X,Y,method="")
method可以为"spearman","pearson" and "kendall",分别对应三种相关系数的计算和检验。
1 perrson相关系数
> n <- 10
> x <- rnorm(n)
> y <- rnorm(n)
> cor(x,y)
[1] -0.4132864
> cor.test(x,y)
Pearson's product-moment correlation
data: x and y
t = -1.2837, df = 8, p-value = 0.2352
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.8275666 0.2924366
sample estimates:
cor
-0.4132864
上面给出了相关系数的可信度区间和P-value
2 spearman相关系数和
kendall相关系数
同上,只要把method改成spearman和kendall
转载自:http://blog.sciencenet.cn/blog-54276-239625.html
学习链接:
http://zoonek2.free.fr/UNIX/48_R/09.html
http://www.cnblogs.com/zhangchaoyang/articles/2631907.html
http://blog.csdn.net/qq_33683364/article/details/53992564
阅读全文
0 0
- 使用R计算相关系数
- 相关系数计算
- 相关系数计算
- 使用R语言绘制其他图形之相关系数图
- R做相关系数图
- Grads中两种相关系数计算
- gdal计算相关系数
- 数据挖掘--相关系数计算
- MATLAB相关系数计算
- matlab 相关系数计算
- python计算相关系数
- Spearman Rank相关系数计算
- python计算相关系数
- MATLAB相关系数计算
- R语言相关系数的可视化
- 皮尔逊相关系数 和 R^2
- Python+pandas计算数据相关系数
- 使用相关系数工具
- 抓包工具
- SpringBoot的RabbitMQ消息队列: 一、消息发送接收第一印象
- jquery源码解析之选择器实现
- iOS实现数据刷新
- 混淆出现Can't process class [com/xxx/xxx/xxx/xxx.class] (Unknown verification type的原因所在
- 使用R计算相关系数
- Oracle中partition for使用的一些简单的理解
- OpenGL 错误获取glGetError()
- DOM操作和BOM操作
- StringBuffer的用法
- Vue.js的安装与介绍
- 连接IBM MQ no mqjbnd in java.library.path错误解决方法
- Linux解决java.security.InvalidKeyException: Illegal key size or default parameters
- http缓存Android