I am building survival model and my code looks something like this:
library('survival')
my.model <- coxhp(Surv(time, event) ~ var_1+var_2+var_3+var_4+var_5, data =df)
The problem is that I have too many variables and set of variables is always changing, I wonder if it would be possible to create list of variables and feed it into model. Something like this:
my.var <- c(var_1+var_2+var_3+var_4+var_5)
my.model <- coxhp(Surv(time, event) ~ my.var, data =df)
I found similar post for linear model linear model solution, but do not know how adapt it to coxph.
You can use "." to mean "all variables not used already". So for your example,
should work.