plot_fit_on_data {lnmixsurv} | R Documentation |
Function used to quick visualize the fitted values (survival estimate) on the data used to fit the model (via EM algorithm or Gibbs).
Description
plot_fit_on_data()
estimates survival/hazard for the data the model was fitted on and plots the results.
Usage
plot_fit_on_data(
model,
data,
type = "survival",
interval = "none",
level = 0.95
)
Arguments
model |
A |
data |
A |
type |
A character string specifying the type of plot. The default is "survival", but can be "hazard". |
interval |
A character string specifying the type of interval to be plotted. The default is "none", but can be "credible". The EM algorithm does not provide confidence intervals and this parameter is only support for the Bayesian version ( |
level |
A numeric value between 0 and 1 specifying the level of the confidence interval. The default is 0.95. |
Value
A list with two objects, one ggplot ($ggplot
) with the predictions plotted against the empirical data and a tibble with the predictions ($preds
).