| Check_Trunc {Colossus} | R Documentation |
Applies time duration truncation limits
Description
Check_Trunc creates columns to use for truncation
Usage
Check_Trunc(df, ce, verbose = FALSE)
Arguments
df |
a data.table containing the columns of interest |
ce |
columns to check for truncation, (t0, t1, event) |
verbose |
boolean to control if additional information is printed to the console, also accepts 0/1 integer |
Value
returns the updated data and time period columns
See Also
Other Data Cleaning Functions:
Check_Dupe_Columns(),
Correct_Formula_Order(),
Date_Shift(),
Def_Control(),
Def_Control_Guess(),
Def_model_control(),
Def_modelform_fix(),
Joint_Multiple_Events(),
Replace_Missing(),
Time_Since(),
factorize(),
factorize_par(),
gen_time_dep(),
interact_them()
Examples
library(data.table)
df <- data.table::data.table("UserID"=c(112, 114, 213, 214, 115, 116, 117),
"Starting_Age"=c(18, 20, 18, 19, 21, 20, 18),
"Ending_Age"=c(30, 45, 57, 47, 36, 60, 55),
"Cancer_Status"=c(0, 0, 1, 0, 1, 0, 0))
# For the interval case
time1 <- "Starting_Age"
time2 <- "Ending_Age"
ce <- c("%trunc%","Ending_Age")
val <- Check_Trunc(df, ce)
df <- val$df
ce <- val$ce
[Package Colossus version 1.1.1 Index]