plot.survfitJM {JM}R Documentation

Plot Method for survfitJM Objects

Description

Produces plots of conditional probabilities of survival.

Usage

## S3 method for class 'survfitJM'
plot(x, estimator = c("both", "mean", "median"), 
    which = NULL, fun = NULL, conf.int = FALSE, 
    fill.area = FALSE, col.area = "grey", col.abline = "black", col.points = "black",
    add.last.time.axis.tick = FALSE, include.y = FALSE, main = NULL, 
    xlab = NULL, ylab = NULL, ylab2 = NULL, lty = NULL, col = NULL, 
    lwd = NULL, pch = NULL, ask = NULL, legend = FALSE, ...,
    cex.axis.z = 1, cex.lab.z = 1)

Arguments

x

an object inheriting from class survfitJM.

estimator

character string specifying, whether to include in the plot the mean of the conditional probabilities of survival, the median or both. The mean and median are taken as estimates of these conditional probabilities over the M replications of the Monte Carlo scheme described in survfitJM.

which

a numeric or character vector specifying for which subjects to produce the plot. If a character vector, then is should contain a subset of the values of the idVar variable of the newdata argument of survfitJM.

fun

a vectorized function defining a transformation of the survival curve. For example with fun=log the log-survival curve is drawn.

conf.int

logical; if TRUE, then a pointwise confidence interval is included in the plot.

fill.area

logical; if TRUE the area defined by the confidence interval of the survival function is put in color.

col.area

the color of the area defined by the confidence interval of the survival function.

col.abline, col.points

the color for the vertical line and the points when include.y is TRUE.

add.last.time.axis.tick

logical; if TRUE, a tick is added in the x-axis for the last available time point for which a longitudinal measurement was available.

include.y

logical; if TRUE, two plots are produced per subject, i.e., the plot of conditional probabilities of survival and a scatterplot of his longitudinal measurements.

main

a character string specifying the title 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.

ylab2

a character string specifying the y-axis label in the plotm when include.y = TRUE.

lty

what types of lines to use.

col

which colors to use.

lwd

the thickness of the lines.

pch

the type of points to use.

ask

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

legend

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

cex.axis.z, cex.lab.z

the par cex argument for the axis at side 4, when include.y = TRUE.

...

extra graphical parameters passed to plot().

Author(s)

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.

Rizopoulos, D. (2010) JM: An R Package for the Joint Modelling of Longitudinal and Time-to-Event Data. Journal of Statistical Software 35 (9), 1–33. doi:10.18637/jss.v035.i09

See Also

survfitJM

Examples

# linear mixed model fit
fitLME <- lme(sqrt(CD4) ~ obstime + obstime:drug, 
    random = ~ 1 | patient, data = aids)
# cox model fit
fitCOX <- coxph(Surv(Time, death) ~ drug, data = aids.id, x = TRUE)

# joint model fit
fitJOINT <- jointModel(fitLME, fitCOX, 
    timeVar = "obstime", method = "weibull-PH-aGH")

# sample of the patients who are still alive
ND <- aids[aids$patient == "141", ]
ss <- survfitJM(fitJOINT, newdata = ND, idVar = "patient", M = 50)
plot(ss)
plot(ss, include.y = TRUE, add.last.time.axis.tick = TRUE, legend = TRUE)

[Package JM version 1.5-2 Index]