
Last chance! 50% off unlimited learning
Sale ends in
## S3 method for class 'jointModel':
plot(x, which = 1:4, caption = c("Residuals vs Fitted",
"Normal Q-Q", "Marginal Survival", "Marginal Cumulative Hazard",
"Marginal log Cumulative Hazard", "Baseline Hazard",
"Cumulative Baseline Hazard", "Subject-specific Survival",
"Subject-specific Cumulative Hazard",
"Subject-specific log Cumulative Hazard"), survTimes = NULL,
main = "",
ask = prod(par("mfcol")) < length(which) && dev.interactive(),
..., ids = NULL, add.smooth = getOption("add.smooth"),
add.qqline = TRUE, add.KM = FALSE, cex.caption = 1)
jointModel
.which
.seq(minT, maxT, length = 15)
, where minT
and
maxT
are the minimum and maximum obsTRUE
, the user is asked before each plot, see par(ask=.)
.TRUE
a smooth line is superimposed in the "Residuals vs Fitted" plot.TRUE
a qq-line is superimposed in the "Normal Q-Q" plot.TRUE
the Kaplan-Meier estimate of the survival function is superimposed in the
"Marginal Survival" plot.jointModel
# linear mixed model fit
fitLME <- lme(log(serBilir) ~ drug * year, random = ~ 1 | id, data = pbc2)
# survival regression fit
fitSURV <- survreg(Surv(years, status2) ~ drug, data = pbc2.id, x = TRUE)
# joint model fit, under the (default) Weibull model
fitJOINT <- jointModel(fitLME, fitSURV, timeVar = "year")
plot(fitJOINT, 3, add.KM = TRUE, col = "red", lwd = 2)
par(mfrow = c(2, 2))
plot(fitJOINT)
Run the code above in your browser using DataLab