plotAUC: ggplot AUC curve

Description Usage Arguments Examples

View source: R/plotAUC.R

Description

ggplot AUC curves

Usage

1
2
plotAUC(x, models, type = "score", lwd = 2, xlim, ylim, axes = TRUE,
  conf.int = FALSE, ...)

Arguments

x

Object obtained with Score.list

models

Choice of models to plot

type

Character. Either "score" to show AUC or "contrasts" to show differences between AUC.

lwd

Line width

xlim

Limits for x-axis

ylim

Limits for y-axis

axes

Logical. If TRUE draw axes.

conf.int

Logical. If TRUE draw confidence shadows.

...

Not yet used

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(survival)
d=sampleData(100,outcome="survival")
nd=sampleData(100,outcome="survival")
f1=coxph(Surv(time,event)~X1+X6+X8,data=d,x=TRUE,y=TRUE)
f2=coxph(Surv(time,event)~X2+X5+X9,data=d,x=TRUE,y=TRUE)
xx=Score(list(f1,f2), formula=Surv(time,event)~1,
data=nd, metrics="auc", null.model=FALSE, times=seq(3:10))
aucgraph <- plotAUC(xx)
plotAUC(xx,conf.int=TRUE)+ggtitle("AUC")+theme_classic()
plotAUC(xx,type="contrasts")
a=plotAUC(xx,type="contrasts",conf.int=TRUE)
a+theme_bw()

riskRegression documentation built on April 19, 2018, 5:04 p.m.