Description Usage Arguments Value Examples
Geometry for ROC
1 |
data |
roc analysis result after 'pROC' or 'ROCit' package |
mapping |
mapping |
size |
line size defaule is 1 |
... |
other attributes |
gemeotry of roc
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 34 35 36 37 38 39 40 41 42 43 | # do three ROC analysis
library(geomROC)
r1 <- rocit(score = Diabetes$bmi, class = Diabetes$dtest)
r2 <- rocit(score = Diabetes$chol, class = Diabetes$dtest)
r3 <- rocit(score = Diabetes$hdl, class = Diabetes$dtest)
#plot one roc curve
ggplot()+
geom_roc(r1)
#plot two roc curves
ggplot()+
geom_roc(r1)+
geom_roc(r2)
#plot three roc curves
ggplot()+
geom_roc(r1)+
geom_roc(r2)+
geom_roc(r3)
#use color
#add color to one roc
ggplot()+
geom_roc(r1,aes(color='bmi'))+
geom_roc(r2)+
geom_roc(r3)
#add color to all
ggplot()+
geom_roc(r1,aes(color='bmi'))+
geom_roc(r2,aes(color='chol'))+
geom_roc(r3,aes(color='hdl'))
#use linetype
ggplot()+
geom_roc(r1,aes(linetype='bmi'))+
geom_roc(r2,aes(linetype='chol'))+
geom_roc(r3,aes(linetype='hdl'))
#use roc_theme()
ggplot()+
geom_roc(r1,aes(linetype='bmi'))+
geom_roc(r2,aes(linetype='chol'))+
geom_roc(r3,aes(linetype='hdl'))+
roc_theme()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.