View source: R/fct_inspection.R
check_surv_mod | R Documentation |
This function tests whether the first of two parametric survival model is lower than a second parametric survival model.
check_surv_mod(
df,
surv_mod_1,
surv_mod_2,
v_names_param_mod_1,
v_names_param_mod_2,
time = seq(0, 5, 0.1),
label_surv_1 = "first survival",
label_surv_2 = "second survival",
n_view = 10
)
df |
a dataframe. |
surv_mod_1 |
character. Name of the parametric model to use for the first survival model. |
surv_mod_2 |
character. Name of the parametric model to use for the second survival model. |
v_names_param_mod_1 |
(vector of) character. Name of the columns containing the parameter values for the first survival model. |
v_names_param_mod_2 |
(vector of) character. Name of the columns containing the parameter values for the second survival model. |
time |
a numerical vector. Determine at which time points survival probabilities have to be estimated for both survival models. For each of these time points, it will be checked whether the first survival model results in higher survival probabilities than the second survival model. |
label_surv_1 |
character vector. The label to provide to the first survival curve (relevant for export). |
label_surv_2 |
character vector. The label to provide to the second survival curve (relevant for export). |
n_view |
integer. Number of iterations to mention in which the curves are crossing. Default is 10. |
The parametric models that can be used are the following: exponential ('exp'
), Weibull ('weibull'
), gamma ('gamma'
), loglogistic ('logis'
), and lognormal ('lnorm'
). All these functions are implemented following their distribution function as documented in the stats package.
A list. The first element is a message, the second element contains the number of the iterations in which the the first curve is higher than the second curve.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.