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?
stateappears to be significant butsexdoesn't seem to be; the whole model, however, is barely significant. If you think thatstatecould have different effects on outcome depending onsexyou could consider adding an interaction ofsex:stateto 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:52stateis its relation to outcome for females, and the coefficient reported forsexmis its relation to outcome whenstate=0. If your values forstateare all well above 0, then that individualsexmcoefficient doesn't represent a situation that occurs in practice. At typicalstatevalues you might have found a significant coefficient forsexm. That the relations of these two to outcome depend on each other's values, however, is correct. – EdM Apr 22 '19 at 14:58