0

I imputed data using MICE and ran a Cox Model using survival.

Output is:

>                        est        se         t        df     Pr(>|t|)  
   factor(ss748)Varian 0.78109445 0.1399757 5.5802158  254.8814 6.130658e-08    
   factor(ss749)Variant 0.43698935 0.2145538 2.0367359  213.579 4.291038e-02  
   factor(ss750)Variant 0.07076991 0.1757233 0.4027350  123.730 6.878381e-01      
   factor(ss751)Variant 0.09796057 0.1304451 0.7509714 4560.5547 4.52786e-01 

>                        lo 95     hi 95      nmis        fmi     lambda  
   factor(ss748)Variant  0.50543827 1.0567506   NA 0.13203983 0.12525575              
   factor(ss749)Variant  0.01407524 0.8599035   NA 0.14480694 0.136835
   factor(ss750)Variant -0.27704297 0.4185828   NA 0.19272691 0.17978321
   factor(ss751)Variant -0.15777509 0.3536962   NA 0.02997128 0.02954597

I understand that the SE relates to the est, so I know to get the CI for the estimates I would do:

(est - 1.96 X se, est + 1.96 x se). 

(which is what the lo 95 and hi 95 columns are). what specific calculation can I do to get the CI for the HR (which is exp(est))?

Can i just do:

(exp(est) -1.96 X se, exp(est) + 1.96 X se) to get CI for HR instead of est?

More plainly, if I wanted to use this table to publish the result (HR=X, 95% CI=X, P Val=X), how do I go about it from the table above?

Thanks

Tom
  • 243
  • 5
  • 13

1 Answers1

2

To get the CI for the hazard ratio you should exponentiate the limits, not the base value, i.e.

exp(c(est - 1.96*se, est + 1.96* se))

or

 exp(est+c(-1.96,1.96)*se)

(for a single CI; if est and se are vectors then the latter approach will not work)

For the output table, something like:

with(output,
   data.frame(HR=exp(est),lwr=exp(est-1.96*se),upr=exp(est+1.96*se),
              pval=`Pr(>|t|)`))

(I'm not 100% sure what you want.) Note these are Normal (not Student-t-based) confidence intervals, but with df>100 it will make only a very tiny difference.

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • Perfect thanks. Can I just clarify that to do this manually, what you're saying is, say if the est=0.49 and se=0.19, then to get the CI of the HR, you say: exp(0.49 - 1.96 X 0.19, 0.49 + 1.96 X 0.195). This is exp( 0.10, 0.87). This is (0.29, 2.3), which is the CI of HR. Sorry for the lack of formatting, I wasn't sure how to do this in a comment. Many thanks again. Appreciated! – Tom Jul 31 '15 at 16:37
  • That's not code that would run because you left out the enclosing `c()` and use "x" instead of "*" but it does express the point that Ben was trying to make. This would be the R code: `exp(c( 0.49 - 1.96 * 0.19, 0.49 + 1.96 * 0.195))`. I'm not sure how that relates to the numbers you offered because I get `[1] 1.12 2.39` when I run that at the console. When you enclose text in flanking backticks it gets displayed as grey-highlighted Courier text. – IRTFM Jul 31 '15 at 17:47