do_kpm {dropR}R Documentation

Kaplan-Meier Survival Estimation

Description

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.

Usage

do_kpm(df, condition_col = "experimental_condition", model_fit = "total")

Arguments

df

data set with do_idx added by add_dropout_idx()

condition_col

character denoting the experimental conditions to model

model_fit

character Should be either "total" for a total model or "conditions"

Value

Returns a list containing steps (survival steps extracted from the fitted models), d (the original data frame), and model_fit (the model fit type).

See Also

survival::Surv() used to fit survival object.

Examples

demo_kpm <- do_kpm(df = add_dropout_idx(dropRdemo, 3:54),
condition_col = "experimental_condition",
model_fit = "total")

head(demo_kpm$steps)


[Package dropR version 1.0.3 Index]