Calculate Survival Curve from Mortality Probabilities
Source:R/adjust_survival_curve.R
get_lifeTable_survival_curve.Rd
This function calculates the survival curve from a given vector of mortality probabilities. The survival curve represents the probability of surviving up to each age or time point, starting from a cohort with an initial size of 1 (or 100
Details
The survival curve (\(S(t)\)) is calculated as the cumulative product of (1 - mortality probability) for each time period.
$$S(t) = \prod_{i=1}^{t} (1 - q_i)$$
where \(q_i\) is the mortality probability at time \(i\).
Examples
if (FALSE) { # \dontrun{
# Define a vector of mortality probabilities
mortality_probs <- df_lifeTable$`Both sexes`
# Calculate the survival curve
survival_curve <- NeuroblastomaPSM::get_lifeTable_survival_curve(
mortality_probs = mortality_probs
)
survival_curve
plot(survival_curve, type = 'l')
} # }