# How to interpret if a COX hazard ratio is dependent on 2 variables

Hi so I'm interested in calculating HR for the following variables. age, state and sex. Univariate calculation using R survival package for example looks something like this.

coxph( Surv(
as.numeric(x[ ,time] ),
as.numeric(x[ ,censor])
)~x\$state , method="exact", data=x)
# if I run this analysis separately I get the following data

beta HR (95% CI for HR) wald.test p.value
sex        -0.16    0.85 (0.62-1.2)      0.91    0.34
Age        0.0098         1 (0.99-1)       1.4    0.25
state      0.36          1.4 (1-2)       4.3   0.038


The thing is, if I run a multivariate analysis I get the following.

coxph( s_obj ~ x$$state + x$$sex+ as.numeric ( x$$age) , method="exact", data=x) coef exp(coef) se(coef) z p x$$state                 0.404596  1.498696  0.177897  2.274 0.0229
x$$sexm -0.153171 0.857983 0.169687 -0.903 0.3667 as.numeric(x$$age)  0.011899  1.011970  0.008561  1.390 0.1646

Likelihood ratio , p=0.04906


I'm trying to interpret this data. My hypothesis is that survival should be dependent on both state and sex. A few questions, should I just dummy code state+sex and run a univariate? Does the data above suggest that state alone independent of sex, effect survival? If I want to truly show that survival is dependent on both state and sex, what would be the best way to do this?

Cox regressions and logistic regressions can have significant omitted variable bias. Omitting a predictor that is related to outcome from such models can bias the coefficients of the predictors that are included even if they are not correlated with the omitted predictor. This answer is one of several on this site that note this problem.

So it is generally unwise to do multiple single-predictor Cox or logistic regressions. The single Cox multiple regression is the best way to go.

That said, have you checked your model for linearity in the numeric predictors (Age and state) and for proportional hazards? Those tests are important for interpreting your results reliably. And how many events do you have? You don't want to have too few events for the number of predictors that you are evaluating.

• thanks; there are 466 events. Assuming that the data meets the criteria I still a bit confused as to how to interpret the multivariate results though - how would I go about testing whether survival is dependent on both sex and state? Apr 21, 2019 at 21:39
• @Ahdee you would look at the coefficients for them in the multiple regression model. state appears to be significant but sex doesn't seem to be; the whole model, however, is barely significant. If you think that state could have different effects on outcome depending on sex you could consider adding an interaction of sex:state to your model. A significant interaction term would imply that they are both important, but in a way that depends on the value of the other. With 466 events you shouldn't have to worry about overfitting when you add an interaction term.
– EdM
Apr 21, 2019 at 21:52
• great idea! I deleted a previous comment and added this edit: interaction not sig however when I added in another important covariate the interaction term is now < .01 however the rest of the variable include state or sex on its own is not and the overall wald's state is also signficant. Can I now safely say that the survival is dependent on the both of the variable and not each one on its own when taken into consideration the set of covariates I provided? thanks. Apr 22, 2019 at 3:40
• @Ahdee the "not each one on its own" part of the statement can be misleading. As you set this up, the individual coefficient reported for state is its relation to outcome for females, and the coefficient reported for sexm is its relation to outcome when state=0. If your values for state are all well above 0, then that individual sexm coefficient doesn't represent a situation that occurs in practice. At typical state values you might have found a significant coefficient for sexm. That the relations of these two to outcome depend on each other's values, however, is correct.
– EdM
Apr 22, 2019 at 14:58
• thank you that was well put and it also helped me to understand more intuitively the changes in pvalue and risk as the covariates are added. Apr 22, 2019 at 15:29