truncate_interval | R Documentation |
Function to truncate survival times in a time interval, for investiganting survival probabilities changes in time.
truncate_interval(data, time_int, startDate, endDate, censor)
data |
data.frame |
time_int |
lubridate::interval output, with the time intervel where the survival times will be truncated |
startDate |
name of the column in data with the birth date of each subject (birth date can be seen as policy begin) |
endDate |
name of the column in data with the death/censor date of each subject |
censor |
name of the column with the censoring status. 1 if endDate is a death date, or 0 if endDate is a censor date. if endDate is later than interval end, then the end date will be the interval end and the status will be censor. |
a data.table with the extra columns: event, dataInicio, dataFim, tempoInicio, tempoFim
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.