Learn R Programming

JM (version 0.8-1)

plot.rocJM: Plot Method for rocJM Objects

Description

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

Usage

## S3 method for class '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, ...)

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.
...
extra graphical parameters passed to plot().

References

Rizopoulos, D. (2010). Dynamic predictions and prospective accuracy in joint models for longitudinal and time-to-event data. Biometrics, accepted. More examples can be found at http://rwiki.sciviews.org/doku.php?id=packages:cran:jm.

See Also

rocJM

Examples

Run this code
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-GH")

ND <- aids[aids$patientroc <- 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