R语言做生信生物信息学习数据科学与R语言

R语言之生信(9)R语言多个生存分析曲线比较

2019-03-22  本文已影响123人  柳叶刀与小鼠标

目录

R语言之生信①差异基因分析1
R语言之生信②差异基因分析2
R语言之生信③差异基因分析3
R语言之生信④TCGA生存分析1
R语言之生信⑤TCGA生存分析2
R语言之生信⑥TCGA生存分析3
R语言之生信⑦Cox比例风险模型(单因素)
R语言之生信⑧Cox比例风险模型(多因素)
R语言之生信(9)R语言多个生存分析曲线比较

======================================
这篇博客的目的主要是计算当需要计算多个不同组之间的成对比较,并计算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: ‘’
上一篇 下一篇

猜你喜欢

热点阅读