Dear Stata listers,
I am trying to evaluate whether depression increases the risk for mortality using the following data through a cox regression, where illness indicate the number of comorbidities and severe the severity of depression:
after I run my regression:
I produce the following output:

I then run
to test that hazards are proportional, and one of my variables violates this assumption (and another one almost does as well):

I've also produced two stph plots, one without the illness variable, and anohter without the severity variable:


As you can see, the hazards looks reasonably proportional when I drop the severity variable, but the overall model loses explanatory power (e.g., HR for depression goes up to ~3).
I'm new to survival analysis and I'm not quite sure how to proceed here. From what I read in previous posts (e.g., https://www.statalist.org/forums/for...t-met-in-stata) it may be appropriate to use the tvc command to include variables that violate the PH assumption, however it seems that this is inappropriate for categorical variabels (e.g., https://www.statalist.org/forums/for...rying-analysis). Another solution that I've come across is to stsplit the data, but since this isn't trial data there isn't an obvious point at which to split the dataset (e.g., post-intervention).
What would be a good solution to this issue?
Best wishes,
Konrad
I am trying to evaluate whether depression increases the risk for mortality using the following data through a cox regression, where illness indicate the number of comorbidities and severe the severity of depression:
Code:
id respsex age depression illness days dead severe bmi meds2 272 female 65.67665 no depression one to two 850 alive no depression 32.70777 None 1425 female 65.66917 no depression one to two 1591 alive no depression 21.66308 antidepressant 2528 female 64.87322 depression one to two 2232 alive subclinical 27.42081 None 1635 female 65.02994 depression one to two 1655 dead no depression 27.29631 antidepressant 2276 male 64.43664 depression one to two 1983 alive moderate 30.81966 None
stcox i.depression i.respsex age bmi i.illness i.severe
I then run
estat phtest, detail
I've also produced two stph plots, one without the illness variable, and anohter without the severity variable:
stphplot, by(depression) adjust(respsex age bmi severe)
Code:
stphplot, by(depression) adjust(respsex age bmi illness)
As you can see, the hazards looks reasonably proportional when I drop the severity variable, but the overall model loses explanatory power (e.g., HR for depression goes up to ~3).
I'm new to survival analysis and I'm not quite sure how to proceed here. From what I read in previous posts (e.g., https://www.statalist.org/forums/for...t-met-in-stata) it may be appropriate to use the tvc command to include variables that violate the PH assumption, however it seems that this is inappropriate for categorical variabels (e.g., https://www.statalist.org/forums/for...rying-analysis). Another solution that I've come across is to stsplit the data, but since this isn't trial data there isn't an obvious point at which to split the dataset (e.g., post-intervention).
What would be a good solution to this issue?
Best wishes,
Konrad
Comment