# 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?

• @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 '19 at 21:52
• @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 '19 at 14:58