I have time-varying and time-invariant predictors in my cox model. What will be the correct way to add both of them using coxph()
? In my model, income, development, and gender are time invariant and gazeaway, gazepicture, and posture are time varying.
I know to add solely time-varying predictors, we need to create intervals which have a start
and stop
time to be fed in the Surv()
function:
model <- coxph(Surv(start, stop, Listener.state) ~ income + development + gender + gazeaway + gazepicture + posture, data=compsviv121)
suumary(model)
coef exp(coef) se(coef) z p
income 0.0399364 1.0407446 0.0136684 2.922 0.00348
development -0.0006316 0.9993686 0.0005616 -1.125 0.26073
gender 0.0604521 1.0623167 0.0259312 2.331 0.01974
gazeaway 0.3122407 1.3664836 0.0608410 5.132 2.87e-07
gazepicture 0.2722540 1.3129205 0.0453264 6.007 1.90e-09
posture -0.1379867 0.8711103 0.0861360 -1.602 0.10916
But is this correct even if I have time-invariant predictors income
, development
, and gender
?