Description Usage Arguments Value Examples
This function assists the user in assessing model performance according to DFBETAs The two plots produced are designed to help the analyst understand which observations are poorly predicted and how model performance fairs with respect to timing of events.
1 | plot_dfbetas(coxph_fit = NULL, var_names = NULL)
|
coxph_fit |
The output from a fitted "coxph" call. |
var_names |
A custom vector of variable names that correspond to the variables in the model. Should be ordered as the covariates enter the model on the RHS of the formula. |
A ggplot2 object presenting the DFBETAs for the model.
1 2 3 4 5 6 7 8 9 10 11 12 | library(survival)
data("heart")
# Coerce from factor
heart$transplant <- as.numeric(heart$transplant)
# Rescale age
heart$age <- heart$age+48
fit <- coxph(Surv(start, stop, event) ~
age + transplant +surgery,
data = heart,
x = TRUE)
plot_dfbetas(coxph_fit = fit, var_names = c("Age", "Transplant", "Surgery"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.