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.
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.
Biometrics67, 819–829.
Rizopoulos, D. (2010) JM: An R Package for the Joint Modelling of Longitudinal and Time-to-Event Data.
Journal of Statistical Software35 (9), 1–33. http://www.jstatsoft.org/v35/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)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(JM)
Loading required package: MASS
Loading required package: nlme
Loading required package: splines
Loading required package: survival
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/JM/plot-survfitJM.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot.survfitJM
> ### Title: Plot Method for survfitJM Objects
> ### Aliases: plot.survfitJM
> ### Keywords: methods
>
> ### ** 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)
>
>
>
>
>
> dev.off()
null device
1
>