Skip to contents

Expects as days since admission:

  • survival.length_of_stay - length of stay until discharge or death (NA if still in hosptial),

  • survival.uncensored_time_to_death - time until death (NA if alive at last obs),

  • survival.last_observed_event - last time patient observed alive.

Usage

derive_survival_censoring(df, v, ...)

Arguments

df

the dataframe.

v

the value set. usually precomputed by the augment framework the value set can be explicitly supplied with v = get_value_sets(df)

...

ignored

Value

a dataframe

Details

Calculates

  • a 30 day survival duration and censoring status for survfit

  • a 1 year survival duration and censoring status for survfit

  • Hospital length of stay and censoring status for survfit

  • Categorical length of stay and 30 day survival 0-3, 4-6, 7-13, 14-29, gte 30

Survival data will be of the form:

survival.30_day_death_xxx, survival.1_yr_death_xxx, survival.30_day_discharge

xxx_time: for this is the follow up time to event in days (max 30 or 365).

xxx_event: The event type indicator

  • 0 = alive at event (censored),

  • 1 = dead.

or for length of stay:

  • 0 = still inpatient / died (censored),

  • 1 = discharged from hospital

A survival model will be of the form:

survival::Surv(time = xxx_time, event=xxx_event) ~ ...