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?


1 Answer 1


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.

  • $\begingroup$ 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? $\endgroup$
    – Ahdee
    Apr 21, 2019 at 21:39
  • $\begingroup$ @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. $\endgroup$
    – EdM
    Apr 21, 2019 at 21:52
  • $\begingroup$ 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. $\endgroup$
    – Ahdee
    Apr 22, 2019 at 3:40
  • $\begingroup$ @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. $\endgroup$
    – EdM
    Apr 22, 2019 at 14:58
  • $\begingroup$ 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. $\endgroup$
    – Ahdee
    Apr 22, 2019 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.