Learn R Programming

JM (version 1.5-2)

plot.rocJM: Plot Method for rocJM Objects

Description

Produces plots of ROC curves and the corresponding areas under the curve.

Usage

# S3 method for rocJM
plot(x, which = NULL, type = c("ROC", "AUC"), 
  ndt = "all", main = NULL, caption = NULL, xlab = NULL, 
  ylab = NULL, ask = NULL, legend = FALSE, lx = NULL, ly = NULL, 
  lty = NULL, col = NULL, cex.caption = 0.8, cex.axis = NULL, 
  cex.lab = NULL, cex.main = NULL, ...)

Arguments

x

an object inheriting from class rocJM.

which

a numeric vector specifying for which generic subjects to produce the plots. This refers to the different cases identified by the idVar argument in rocJM.

type

a character string specifying which plot to produce the ROC curves or the areas under the ROC curves.

ndt

the character string "all" or a numeric scalar specifying for which time windows (dt argument of rocJM) to produce the plots.

main

a character string specifying the title in the plot.

caption

a character string specifying a caption in the plot.

xlab

a character string specifying the x-axis label in the plot.

ylab

a character string specifying the y-axis label in the plot.

ask

logical; if TRUE, the user is asked before each plot, see par().

legend

logical; if TRUE, a legend is included in the plot.

lx,ly

the x and y arguments of legend().

lty

what types of lines to use.

col

which colors to use.

cex.caption

font size for the caption.

cex.axis, cex.lab, cex.main

graphical parameters; see par for more info.

...

extra graphical parameters passed to plot().

Author

Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl

References

Rizopoulos, D. (2012) Joint Models for Longitudinal and Time-to-Event Data: with Applications in R. Boca Raton: Chapman and Hall/CRC.

Rizopoulos, D. (2011). Dynamic predictions and prospective accuracy in joint models for longitudinal and time-to-event data. Biometrics 67, 819--829.

See Also

rocJM

Examples

Run this code
if (FALSE) {
fitLME <- lme(sqrt(CD4) ~ obstime + obstime:(drug + AZT + prevOI + gender), 
    random = ~ obstime | patient, data = aids)
fitSURV <- coxph(Surv(Time, death) ~ drug + AZT + prevOI + gender, 
    data = aids.id, x = TRUE)
fit.aids <- jointModel(fitLME, fitSURV, timeVar = "obstime", 
    method = "piecewise-PH-aGH")

ND <- aids[aids$patient == "7", ]
roc <- rocJM(fit.aids, dt = c(2, 4, 8), ND, idVar = "patient")
plot(roc, lwd = 2, legend = TRUE)
plot(roc, type = "AUC")
}

Run the code above in your browser using DataLab