admin_censor_cmprisk | R Documentation |
admin_censor_cmprisk
admin_censor_cmprisk(
df,
evt_time,
evt,
adm_cnr_time = NULL,
evt_label = NULL,
overwrite_var = FALSE
)
df |
input data |
evt_time |
a numeric vector recording the time points at which the event occurs. |
evt |
a factor vector indicating right censoring (0= censored; 1= event of interest; other= competing risk(s)). |
adm_cnr_time |
a numeric vector specifying the time point at which administrative censoring is applied. |
evt_label |
a numeric vector specifying the time point at which administrative censoring is applied. |
overwrite_var |
a logical scalar (default= FALSE) indiciates if the existing time-to-event variables should be overwritten. |
The function creates time-to-event variables with the application of administrative censoring for a competing risk analysis. The newly created variables are named by the same variables names but with a suffix of '_adm' by default. The original variables can be overwritten by specifying overwrite_var= TRUE. Overwriting the original variables is not recommended, but it can be useful in some situation.
The input data plus censored time-to-event variables.
cmprisk_df<- read.csv2("http://www.stat.unipg.it/luca/misc/bmt.csv")
admin_censor_cmprisk(cmprisk_df, ftime, status, evt_label = c("0"= "Event free", "1"= "Event", "2"= "Competing event"), adm_cnr_time= 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.