Learn R Programming

riskRegression (version 1.3.7)

plotAUC: Plot AUC curve

Description

Plot AUC curve

Usage

plotAUC(x, models, which = "score", xlim, ylim, xlab, ylab, col, lwd,
  lty = 1, cex = 1, pch = 1, type = "l", axes = 1L, percent = 1L,
  confint = 0L, legend = 1L, ...)

Arguments

x

Object obtained with Score

models

Choice of models to plot

which

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

xlim

Limits for x-axis

ylim

Limits for y-axis

xlab

Label for x-axis

ylab

Label for y-axis

col

line color

lwd

line width

lty

line style

cex

point size

pch

point style

type

line type

axes

Logical. If TRUE draw axes.

percent

Logical. If TRUE scale y-axis in percent.

confint

Logical. If TRUE draw confidence shadows.

legend

Logical. If TRUE draw legend.

...

Used for additional control of the subroutines: plot, axis, lines, legend. See SmartControl.

Examples

Run this code
library(survival)
set.seed(21)
d=sampleData(50,outcome="survival")
nd=sampleData(50,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("Cox X1+X6+X8"=f1,"Cox X2+X5+X9"=f2), formula=Surv(time,event)~1,
         data=nd, metrics="auc", nullModel=FALSE, times=seq(3:10))
plotAUC(xx)
plotAUC(xx,confint=TRUE)
plotAUC(xx,which="contrasts")

Run the code above in your browser using DataLab