I am little bit crazy trying to run a penalized cox ph regression model with functions of rms package. I’ve done it with glmnet package but I would like to analize the outputs with rms and Hmisc functions later. Is it possible to do so with cph() function? as well, how can be performed with cross-validation to found the optimum lambda which leads e.g. to a minimum mean cross-validated error.
Any help or do you have an example to follow? Thank you
I need to run cph() function to develop a cox ph model with penalization, but I do not know how to proceed. I expect to know if it's possible to do that and how, and much better if it's possible including an example.
I don't think you can do penalized regression directly in the
rmspackage, but you could fit a penalized cox model separately, and then use the coefficients from that as the starting point in thecphfunction:EDIT: Adding splines and interactions: