This function plots objects of class "model_diagnostics_survival" created using the model_diagnostics() function.

# S3 method for model_diagnostics_survival
plot(
  x,
  ...,
  plot_type = "deviance",
  xvariable = "index",
  smooth = as.logical(xvariable != "index"),
  facet_ncol = NULL,
  title = "Model diagnostics",
  subtitle = "default",
  colors = NULL
)

Arguments

x

an object of class model_diagnostics_survival to be plotted

...

additional objects of class model_diagnostics_survival to be plotted together

plot_type

character, either "deviance", "martingale" or "Cox-Snell". Selects the type of plot to be prepared. If "deviance" or "martingale then deviance/martingale residuals are plotted against xvariable. If "Cox-Snell" then diagnostic plot of Cox-Snell residuals is prepared, which is CHF estimated based on Cox-Snell residuals against theoretical cumulative hazard trajectory of the Exp(1) -- diagonal line.

xvariable

character, name of the variable to be plotted on x-axis (can be name of the variable to be drawn on the x-axis (can be any column from the x$result: explanatory variable, time, other residuals). By default "index" which gives the order of observations.

smooth

logical, shall the smooth line be added. Only used when plot_type = "deviance" or plot_type = "martingale".

facet_ncol

number of columns for arranging subplots

title

character, title of the plot

subtitle

character, subtitle of the plot, "default" automatically generates "created for XXX, YYY models", where XXX and YYY are the explainer labels

colors

character vector containing the colors to be used for plotting (containing either hex codes "#FF69B4", or names "blue").

Value

An object of the class ggplot.