surv_extract_km: Extract survival probabilities and 'failure' probabilities

View source: R/surv_extract.R

surv_extract_kmR Documentation

Extract survival probabilities and 'failure' probabilities

Description

Uses a previously adjusted survfit model and returns the results in a standard and convenient way. Works only for K-M estimates.

Usage

surv_extract_km(aj)

Arguments

aj

aj previously fitted model (using 'survival::survfit()').

Value

a data.frame with the following columns: 'time', 'id', 'surv' and 'wx'. 'id' is the value of the covariates in the model. If more than one covariate is used, they are merged together using 'tidyr::unite'. 'surv' is the survival probability and 'wx' is n.event/n.risk, closely related with the probability of failing before x + 1, for individuals alive at x.


vitorcapdeville/survtools documentation built on Feb. 12, 2023, 12:01 p.m.