| Convert_Model_Eq | R Documentation |
Convert_Model_Eq Converts a string expression of a risk model into the vectors used by different Colossus regression functions
Convert_Model_Eq(Model_Eq, df)
Model_Eq |
String representation of a survival model. Left-hand side details the model (cox, poisson, cox_strata, poisson_strata), time columns, event, and strata when used. The right-hand side details the subterm effects. The 'Unified Equation Representation' vignette provides more details. |
df |
a data.table containing the columns of interest |
returns a list of regression inputs
Other Data Cleaning Functions:
Check_Dupe_Columns(),
Check_Trunc(),
Check_Verbose(),
Correct_Formula_Order(),
Date_Shift(),
Def_Control(),
Def_Control_Guess(),
Def_model_control(),
Def_modelform_fix(),
Event_Count_Gen(),
Event_Time_Gen(),
Joint_Multiple_Events(),
Replace_Missing(),
Time_Since(),
factorize(),
factorize_par(),
gen_time_dep(),
interact_them()
library(data.table)
a <- c(0, 1, 2, 3, 4, 5, 6)
b <- c(1, 2, 3, 4, 5, 6, 7)
c <- c(0, 1, 0, 0, 0, 1, 0)
d <- c(1, 2, 3, 4, 5, 6, 7)
e <- c(2, 3, 4, 5, 6, 7, 8)
table <- data.table::data.table(
"a" = a, "b" = b, "c" = c,
"d" = d, "e" = e
)
Model_Eq <- "cox(a,b, c) ~ loglinear(d, factor(e), 0) + multiplicative()"
e <- Convert_Model_Eq(Model_Eq, table)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.