pROC包绘制ROC曲线

R包pROC进行ROC曲线分析

R包pROC可以进行ROC曲线分析,涉及的主要函数是roc函数和plot.roc函数:

以自带数据为例:

library(pROC)
data("aSAH")
head(aSAH,10)
   gos6 outcome gender age wfns s100b  ndka
29    5    Good Female  42    1  0.13  3.01
30    5    Good Female  37    1  0.14  8.54
31    5    Good Female  42    1  0.10  8.09
32    5    Good Female  27    1  0.04 10.42
33    1    Poor Female  42    3  0.13 17.40
34    1    Poor   Male  48    2  0.10 12.75
35    4    Good   Male  57    5  0.47  6.00
36    1    Poor   Male  41    4  0.16 13.20
37    5    Good Female  49    1  0.18 15.54
38    4    Good Female  75    2  0.10  6.01

根据数据显示内容,选择:s100b对outcome进行分析

> outcome=roc(response=aSAH$outcome,predictor = aSAH$s100b)
> outcome

Call:
roc.default(response = aSAH$outcome, predictor = aSAH$s100b)

Data: aSAH$s100b in 72 controls (aSAH$outcome Good) < 41 cases (aSAH$outcome Poor).
Area under the curve: 0.7314

respone      a factor, numeric or character vector of responses, typically encoded with 0 (controls) and 1 (cases).    进行分类

predictor     a numeric vector of the same length thanresponse, containing the predicted value of each observation. An ordered factor is coerced to a numeric.  进行预测

AUC 0.7314

基于返回结果绘制ROC曲线

plot.roc(outcome)


attachments-2019-02-kZCSBCnE5c6f658be3155.jpg简单进行美化

> plot.roc(outcome,col="red",print.auc =TRUE,print.auc.col = "darkgreen",auc.polygon = TRUE,auc.polygon.col = "pink")


attachments-2019-02-LcXm2NTk5c6f671aa9c7f.jpg

相关课程:GEO芯片数据挖掘GEO芯片数据标准化


更多生物信息课程:

1. 文章越来越难发?是你没发现新思路,基因家族分析发2-4分文章简单快速,学习链接:基因家族分析实操课程基因家族文献思路解读

2. 转录组数据理解不深入?图表看不懂?点击链接学习深入解读数据结果文件,学习链接:转录组(有参)结果解读转录组(无参)结果解读

3. 转录组数据深入挖掘技能-WGCNA,提升你的文章档次,学习链接:WGCNA-加权基因共表达网络分析

4. 转录组数据怎么挖掘?学习链接:转录组标准分析后的数据挖掘转录组文献解读

5. 微生物16S/ITS/18S分析原理及结果解读OTU网络图绘制cytoscape与网络图绘制课程

6. 生物信息入门到精通必修基础课:linux系统使用perl入门到精通perl语言高级R语言入门R语言画图

7. 医学相关数据挖掘课程,不用做实验也能发文章:TCGA-差异基因分析GEO芯片数据挖掘GEO芯片数据标准化GSEA富集分析课程TCGA临床数据生存分析TCGA-转录因子分析TCGA-ceRNA调控网络分析

8.其他,二代测序转录组数据自主分析NCBI数据上传二代测序数据解读



  • 发表于 2019-02-22 10:48
  • 阅读 ( 9986 )
  • 分类:R

0 条评论

请先 登录 后评论
Daitoue
Daitoue

167 篇文章

作家榜 »

  1. omicsgene 658 文章
  2. 安生水 328 文章
  3. Daitoue 167 文章
  4. 生物女学霸 120 文章
  5. 红橙子 78 文章
  6. CORNERSTONE 72 文章
  7. xun 68 文章
  8. rzx 67 文章