do_kpm | R Documentation |
This function needs a data set with a dropout index added by add_dropout_idx()
.
The do_kpm
function performs survival analysis with Kaplan-Meier Estimation
and returns a list containing survival steps, the original data frame, and the model fit type.
The function can fit the survival model either for the entire data set or separately by a specified condition column.
do_kpm(df, condition_col = "experimental_condition", model_fit = "total")
df |
data set with |
condition_col |
character denoting the experimental conditions to model |
model_fit |
character Should be either "total" for a total model or "conditions" |
Returns a list containing steps
(survival steps extracted from the fitted models),
d
(the original data frame), and model_fit
(the model fit type).
survival::Surv()
used to fit survival object.
demo_kpm <- do_kpm(df = add_dropout_idx(dropRdemo, 3:54),
condition_col = "experimental_condition",
model_fit = "total")
head(demo_kpm$steps)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.