Description Usage Arguments Value Examples
This function assists the user in assessing model performance according to Martingale residuals. A list of plots. There will be two plots for each covariate. One showing the Martingale residuals per model with and without the covariate.
1 | plot_martingale_residuals(coxph_fit = NULL)
|
coxph_fit |
The output from a fitted "coxph" call. |
A ggplot2 object presenting the martingale residuals for the model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(survival)
data("heart")
# Coerce from factor
heart$transplant <- as.numeric(heart$transplant)
# Rescale age
heart$age <- heart$age+48
coxph_fit <- coxph(Surv(start, stop, event) ~
age + transplant +surgery,
data = heart,
x = TRUE)
plot_list <- plot_martingale_residuals(coxph_fit = coxph_fit)
Rmisc::multiplot(plotlist = plot_list, cols = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.