Description Usage Arguments Value Author(s) Examples
This function transforms data from long format (one record per event) to a datalist with length as unique subject number. The transformation is required before fitting other models from the package.
1 | uc_data_transform(data,var_list,var_list_new,time,prob)
|
data |
The dataset in long format with a row for each potential event. For ceonsoring record, the event prob should be 0. It should include id, time and prob variables at a minimum. If any covariates are included in the call to the function, then these variables should also be included. A censoring record is required for each subject. Categorical variables need to be encoded as factor varaible before transformationif they are expected to be in the Cox model. |
var_list |
The list of identification variables, such as: c("id_long","trt_long"). |
time |
The time variable need to be transofirmed, e.g. time_long. |
prob |
The prob variable need to be transformed, e.g. prob_long. |
var_list_new |
The character vector contains the new names for the id variables defined in the var_list, if missing, previous variable names would be used. |
time |
The list of all potential event time |
prob |
The list of all potential event probabilities |
weights |
The list of all potential event weights |
e |
The list of individual potential event count |
s |
The list of all survival probabilities |
data_uc |
The dataset contains unique information of each subject |
data_long |
The dataset contains the original data in long format |
Yiming Chen
1 2 3 4 5 6 7 | |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.