I'm interested in testing sex differences in the outcome Y (e.g., mortality), and if there are sex differences in the effect of BMI on mortality.
I planned to use a Cox regression model
primary<-coxph(Surv(time,status) ~ sex, data=data) second<-coxph(Surv(time,status) ~ sex*bmi, data=data)
And my first question is 1) if I can test proportionality assumption for an interaction. I use cox.zph function for the test
cox.zph(second)
and I'm wondering if it makes sense to test an assumption for an interaction term, and if this is the right way to do it.
Also, when I tested the assumption of proportionality for the first model (no interaction term), it was violated for sex. I read that the nonproportionality could be handled by including the time*covariate interaction term, so I did that...
coxph(Surv(start, stop, status.time) ~ sex+sex:stop, data=longdata)
And I think I can report that sex differences decreased over time (the interaction was significant), but I'm wondering what this means for my research question about the bmi*sex interaction ('second' model)...
2) should I include a three-way interaction term for that?
coxph(Surv(start, stop, status.time) ~ sex*bmi+sex:stop+sex:bmi:stop, data=longdata)
Thanks in advance for your help!!
cox.zph()to get an idea about what might be going on. Based on your initial finding that PH is violated bysexas a single predictor, I'd suggest starting with stratification bysex. Also, not modelingbmiproperly to meet the linearity assumption of the regression could lead to loss of PH; see this question for a worked-out example. With a large data set use regression splines forbmito help with any linearity problem, provided byrcs()terms from the Rrmspackage. – EdM Jun 16 '19 at 19:42rcs(bmi)means thatbmiis important overall as a predictor. The spline fits the nonlinear shape of the relation ofbmito outcome; with a large data set it makes sense to include the spline to improve linearity of the model as a whole even if the higher-order spline terms forbmiaren't individually "significant." – EdM Jun 16 '19 at 21:48