#年龄画箱线图
colnames(Age.2)=c('年龄', '分组')
p<-ggboxplot(Age.2, x="分组", y="年龄", color = "分组",
palette = c("#FC4E07", "#00AFBB"), #, "#FC4E07" #E7B800
add = "jitter",shape="分组")
my_comparisons <- list(c("ASD", "CTL"))
p+stat_compare_means(comparisons = my_comparisons)+stat_compare_means(label.y=68)
p+stat_compare_means(label.y=65, label.x = 1.4)
#箱线图+小提琴
ggviolin(Age.2, x="分组", y="年龄", fill = "分组",
palette = c("#FC4E07", "#00AFBB"),
add = "boxplot", add.params = list(fill="white"))+
stat_compare_means(comparisons = my_comparisons, label ="p.signif")+
stat_compare_means(label.y = 75,label.x = 1.3)#label这里表示选择显著性标记(星号)
网友评论