## 临床数据 两两比较 加显著性boxplot加显著性
临床数据 两两比较 加显著性
输入数据格式
#读取输入文件
rt=read.table(inputFile,sep=“\t”,header=T,check.names=F)
head(rt)
table(rt$Stage)
x=colnames(rt)[2]
y=colnames(rt)[3]
colnames(rt)=c(“id”,“Type”,“Expression”)
#设置比较租
group=levels(factor(rt T y p e ) ) r t Type)) rt Type))rtType=factor(rt$Type, levels=group)
comp=combn(group,2) #产生两两随机组合
my_comparisons=list()
for(i in 1:ncol(comp)){my_comparisons[[i]]<-comp[,i]}
my_comparisons
#绘制boxplot
boxplot=ggboxplot(rt, x=“Type”, y=“Expression”, color=“Type”,
xlab=x,
ylab=y,
legend.title=x,
add = “jitter”)+
stat_compare_means(comparisons = my_comparisons)