Description Usage Arguments Author(s) Examples
View source: R/base_compareROC2.R
compareROC2 helps get ROC curves of one or more variates for a binary status.It supports the merge of lots of variates via glm function.
| 1 2 3 4 5 | 
| data | a data frame | 
| markers | target markers | 
| status | the dependent variable in ROC.like "N.status" | 
| merge.markers | A list of markers you want to merge.Default is NULL.The merge stragegy is based on Generalized Linear Models(glm) | 
| roc.type | one of "ggplot" and "pROC"."ggplot" is recommanded and the default setting | 
| title | the plot title | 
| color | Default is NULL.You can set other colors like "#8DD3C7" | 
| half.border | whether to show half border style | 
| reference | whether to show a reference line in ROC plot | 
| legend.position | the position of legend in ggplot | 
| show.auc | whether to show related auc in legend labels | 
| auc.digits | the digits of auc in legend labels | 
| width, height | the size of saved PDF plot | 
| names | part of saved PDF plot names | 
Weibin Huang<654751191@qq.com>
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## This is a simulative process and NOT RUN
train.LM.ROC <- compareROC2(
 data = design.x,
 markers = mgenes.s,
 status ="lymphatic.metastasis",
 merge.markers=list(merge = mgenes.s),
 roc.type = "ggplot",
 title="ROC Curves of Lymphatic Metastasis",
 color = mycolor[c(1,20,3,5,6,7,4)],
 legend.position=c(0.8,0.2),
 show.auc = T,auc.digits = 2,
 width = 10,height = 10,
 names =paste0("seed",seed,"_train.mgenes")
)
## Quick Start
data(fat)
markers=c("BMI","Waist","WHR","belly fat thickness") #marker #'colnames
status =  "outcomes" #survival status
merge.markers = list(c("BMI","Waist"))# the markers list that you want to merge as a co-prognostic factor
return.plot = T # if T,return plot;if F,return data
roc.type = c("ggplot","pROC")[1] # ggplot style is recommanded
title="this is a title" # plot title
color = brewer.pal(12, "Set3")[1:5] #curve colors.The lenght of colors must >= the number of curves.
output.name = "ROC of something" # part of PDF name
compareROC2(data=fat,
           markers,
           status,
           merge.markers=NULL,
           return.plot=T,
           roc.type,
           title,
           color,
           output.name="test1")
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.