I´d like to use RCS to test for non-linearity after testing for linearity using coxph. I have a variable that does not meet the proportional hazard assumption ("t4_examination_age_F1"). In the coxph statment I can include a time transform function to account for this. The code is as follows:
I´d like to use RCS to test for non-linearity after testing for linearity using coxph. I have a variable that does not meet the proportional hazard assumption ("t4_examination_age_F1"). In the coxph statment I can include a time transform function to account for this. The code is as follows:
Now I´d like to use rcsplot. But how do I include the time transform function in this code?
I tried using the same trick as in coxph, but this does not work:
I get this error: tt(t4_examination_age_F1) are (is) not included in the data frame.
I would be very grateful for any kind of help of how to account for the proportional hazard assumption violation of my variable in rcsplot. Thank you!