cfc.prepdata {CFC} | R Documentation |
Preparing a data frame and formulas for cause-specific competing-risk survival analysis. It expands the multi-state status column into a series of binary columns by treating an event for a cause as censoring for all other causes.
cfc.prepdata(formul, dat)
formul |
Original survival formula. |
dat |
Original data frame, with |
The output data frame will have K
new binary status columns. The K
new status columns will be named "status_1"
, "status_2"
through "status_<K>"
. Each of the output formulas in formula.list
field will have the corresponding status
. Column "status_1" will be 1
wherever status
equals 1
in original data frame, and 0
elsewhere, and similarly for the remaining K-1
newly-added status columns.
A list with the following elements:
K |
Number of causes. |
dat |
Expanded data frame. |
formula.list |
A list of |
formula.noresp |
A formula with no left-hand side (time and status variables). This can be used for preparing the model matrix for prediction data sets, which can possibly have no response. |
tmax |
Maximum time to event/censoring extracted from original data frame. This can be used, e.g., during competing-risk analysis. |
Mansour T.A. Sharabiani, Alireza S. Mahani
Mahani A.S. and Sharabiani M.T.A. (2019). Bayesian, and Non-Bayesian, Cause-Specific Competing-Risk Analysis for Parametric and Nonparametric Survival Functions: The R Package CFC. Journal of Statistical Software, 89(9), 1-29. doi:10.18637/jss.v089.i09
data(bmt)
prep.out <- cfc.prepdata(Surv(time, cause) ~ platelet + age + tcell, bmt)