====================================== 这篇博客的目的主要是计算当需要计算多个不同组之间的成对比较,并计算P值。
主要使用的函数是:pairwise_survdiff(formula,data,p.adjust.method =“BH”,na.action,rho = 0)
> library(survival)
> library(survminer)
> data(myeloma)
>
> # Pairwise survdiff
> res <- pairwise_survdiff(Surv(time, event) ~ molecular_group,
+ data = myeloma)
> res
查看输出结果
Pairwise comparisons using Log-Rank test
data: myeloma and molecular_group
Cyclin D-1 Cyclin D-2 Hyperdiploid Low bone disease MAF MMSET
Cyclin D-2 0.723 - - - - -
Hyperdiploid 0.943 0.723 - - - -
Low bone disease 0.723 0.988 0.644 - - -
MAF 0.644 0.447 0.523 0.485 - -
MMSET 0.328 0.103 0.103 0.103 0.723 -
Proliferation 0.103 0.038 0.038 0.062 0.485 0.527
P value adjustment method: BH
通过这个矩阵我们可以看到molecular_group 水平上两两之间的生存分析对比的P值。 下一步我们可以将数字转化成符号,代表我们不同的P值水平。
> symnum(res$p.value, cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 0.1, 1),
+ symbols = c("****", "***", "**", "*", "+", " "),
+ abbr.colnames = FALSE, na = "")
Cyclin D-1 Cyclin D-2 Hyperdiploid Low bone disease MAF MMSET
Cyclin D-2
Hyperdiploid
Low bone disease
MAF
MMSET
Proliferation * * +
attr(,"legend")
[1] 0 ‘****’ 1e-04 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘+’ 0.1 ‘ ’ 1 \t ## NA: ‘’
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有