pangxie的个人博客分享 http://blog.sciencenet.cn/u/pangxie

博文

R语言计算spearman相关性

已有 7635 次阅读 2020-10-3 20:36 |个人分类:R语言|系统分类:科研笔记

install.packages("psych")

library(psych)

all=read.csv("1.csv")

image.png

abc <- corr.test(data.frame(all),method="spearman",adjust="none")

write.table(t(abc$r),"spearmanr.txt",sep="\t")

image.png

write.table(t(abc$p),"spearmanp.txt",sep="\t")

bcd <- corr.test(data.frame(all),method="pearson",adjust="none")

write.table(t(bcd$r),"pearsonr1.txt",sep="\t")

write.table(t(bcd$p),"pearsonp1.txt",sep="\t")




https://wap.sciencenet.cn/blog-3448646-1253096.html

上一篇:[转载]ggplot2箱线图加散点图
下一篇:聚类分析
收藏 IP: 36.149.78.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

全部作者的其他最新博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-3-30 08:08

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部