R语言 热力图,相关系数图, 美化,以及各种调参。

该博客使用R语言对纹理特征进行相关性分析,通过Kurskal-Wallis检验筛选出与病理总评分高度相关的特征,并用corrplot库创建相关性矩阵和热力图,进行了调参美化。
摘要由CSDN通过智能技术生成

#correlation of texture
setwd("C:/Users/jack/Desktop/mission/correlation/texture")
library(readxl)
T2WI <- read_excel("Crosswise_Texture features and histological features.xlsx", 
                   sheet = "T2WI")
SWI <- read_excel("Crosswise_Texture features and histological features.xlsx", 
                   sheet = "SWI")
T2star <- read_excel("Crosswise_Texture features and histological features.xlsx", 
                   sheet = "T2star")

score <- read_excel("Crosswise_Texture features and histological features.xlsx", 
                                                                   sheet = "score")

##1、比较五组间差异(非参数方差分析),将有差异的纹理特征筛选出来#Kurskal-Wallis检验是Wilcoxon方法(其实是Mann-Whitney检验)用于多个样本。当对两个样本进行比较的时候,Kurskal-Wallis检验与Mann-Whitney检验是等价的。
#T2WI
T2WI_selected<-c()
T2WI_feature<-T2WI[,-c(1,2)]
for (feature in names(T2WI_feature)){
  result_temp <- kruskal.test(T2WI[[feature]]~T2WI$Group)
  if (result_temp$p.value<0.05) {
    T2WI_selected<-c(T2WI_selected,feature)
  }
}
#SWI
SWI_selected<-c()
SWI_feature<-SWI[,-c(1,2)]
for (feature in names(SWI_feature)){
  result_temp <- kruskal.test(SWI[[feature]]~SWI$Group)
  if (result_temp$p.value<0.05) {
    SWI_sele

  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值