Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • For some reason I want to know the Coef. of each variators in Cox proportional hazard model

    By default the output is hazard ratio. According to the logic behind Cox proportional hazard model, the point estimation of hazard ratio equals exp(bi), where bi is the predicted coef. I just want to find the point estimation and confidence interval for bi. I tried the 'help stcox' syntax but no luck.

    Code:
     stcox i.ttestforweightstatus i.ageforttest i.gendercode i.af i.hypertension i.chf i.hypoalbumi
    > nemiaforttest i.akiforttest i.potentialamiodaroneddi i.ttestindication i.ttesttargetinr i.afan
    > dwarfarinhistory i.non11ornon1non1 i.nonaaornonanona
    
             failure _d:  firsttherapeuticinrreached
       analysis time _t:  timetofirsttherapeuticinrd
    
    Iteration 0:   log likelihood = -609.64264
    Iteration 1:   log likelihood = -585.42388
    Iteration 2:   log likelihood = -582.50792
    Iteration 3:   log likelihood = -582.47598
    Iteration 4:   log likelihood = -582.47597
    Refining estimates:
    Iteration 0:   log likelihood = -582.47597
    
    Cox regression -- Breslow method for ties
    
    No. of subjects =          174                  Number of obs    =         174
    No. of failures =          135
    Time at risk    =         1066
                                                    LR chi2(14)      =       54.33
    Log likelihood  =   -582.47597                  Prob > chi2      =      0.0000
    
    -------------------------------------------------------------------------------------------
                           _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
    --------------------------+----------------------------------------------------------------
       1.ttestforweightstatus |   1.020393   .2929401     0.07   0.944     .5812992    1.791163
                1.ageforttest |   1.498247   .3518103     1.72   0.085     .9456026    2.373875
                 1.gendercode |   1.390171   .2653018     1.73   0.084     .9563653    2.020749
                         1.af |   .5818911   .1519922    -2.07   0.038     .3487422    .9709098
               1.hypertension |   .7258801   .1602377    -1.45   0.147     .4709367    1.118838
                        1.chf |   1.670382   .4451392     1.93   0.054     .9907856    2.816126
    1.hypoalbuminemiaforttest |   2.158257   .6137253     2.71   0.007     1.236101    3.768358
                1.akiforttest |   1.268841   .3458445     0.87   0.382     .7436999    2.164796
     1.potentialamiodaroneddi |   .7580945   .1894779    -1.11   0.268     .4644878    1.237293
            1.ttestindication |   1.543941   .4843595     1.38   0.166     .8348241    2.855397
             1.ttesttargetinr |   1.465928   .5007634     1.12   0.263     .7504831    2.863416
       1.afandwarfarinhistory |   1.260178   .3985813     0.73   0.465     .6779624    2.342384
            1.non11ornon1non1 |   2.250942   .6506658     2.81   0.005     1.277359    3.966577
            1.nonaaornonanona |   .2831169   .0924991    -3.86   0.000     .1492326    .5371155
    -------------------------------------------------------------------------------------------

  • #2
    Tom:
    you may want to try something along the following lines:
    Code:
    . use http://www.stata-press.com/data/r14/drugtr.dta
    (Patient Survival in Drug Trial)
    
    . stcox i.drug age, nohr
    
             failure _d:  died
       analysis time _t:  studytime
    
    Iteration 0:   log likelihood = -99.911448
    Iteration 1:   log likelihood = -83.551879
    Iteration 2:   log likelihood = -83.324009
    Iteration 3:   log likelihood = -83.323546
    Refining estimates:
    Iteration 0:   log likelihood = -83.323546
    
    Cox regression -- Breslow method for ties
    
    No. of subjects =           48                  Number of obs    =          48
    No. of failures =           31
    Time at risk    =          744
                                                    LR chi2(2)       =       33.18
    Log likelihood  =   -83.323546                  Prob > chi2      =      0.0000
    
    ------------------------------------------------------------------------------
              _t |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          1.drug |  -2.254965   .4548338    -4.96   0.000    -3.146423   -1.363507
             age |   .1136186   .0372848     3.05   0.002     .0405416    .1866955
    ------------------------------------------------------------------------------
    .
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Tom,
      The nohr option is what you want. It's definitely listed under help stcox!
      Best wishes,
      David.

      Comment


      • #4
        Indeed, the information is available in the example 1 of the Stata Manual, page 75, as disclosed here:


        Once an stcox model has been fit, typing stcox without arguments redisplays the previous results. Options that affect the display, such as nohr—which requests that coefficients rather than hazard ratios be displayed—can be specified upon estimation or when results are redisplayed
        Best regards,

        Marcos

        Comment


        • #5
          Thank you, all. And is there a syntax similar as 'estat vif' for multiple linear regress to detect interactions?

          Comment


          • #6
            Tom:
            no, there's no a built-in Stata command similar to -estat vif- to detect quasi-extreme multicollinearity after -stcox-.
            That said, you can use -estat vce, corr-:
            Code:
            . use http://www.stata-press.com/data/r14/drugtr.dta
            (Patient Survival in Drug Trial)
            
            . stcox i.drug age, nohr
            
                     failure _d:  died
               analysis time _t:  studytime
            
            Iteration 0:   log likelihood = -99.911448
            Iteration 1:   log likelihood = -83.551879
            Iteration 2:   log likelihood = -83.324009
            Iteration 3:   log likelihood = -83.323546
            Refining estimates:
            Iteration 0:   log likelihood = -83.323546
            
            Cox regression -- Breslow method for ties
            
            No. of subjects =           48                  Number of obs    =          48
            No. of failures =           31
            Time at risk    =          744
                                                            LR chi2(2)       =       33.18
            Log likelihood  =   -83.323546                  Prob > chi2      =      0.0000
            
            ------------------------------------------------------------------------------
                      _t |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                  1.drug |  -2.254965   .4548338    -4.96   0.000    -3.146423   -1.363507
                     age |   .1136186   .0372848     3.05   0.002     .0405416    .1866955
            ------------------------------------------------------------------------------
            
            . estat vce, corr
            
            Correlation matrix of coefficients of cox model
            
                         |        1.         
                    e(V) |     drug       age
            -------------+--------------------
                  1.drug |   1.0000          
                     age |  -0.2281    1.0000
            
            .
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Carlo gave insightful reply.

              Just to avoid misunderstanding: as Carlo politely pointed out, neither -estat vif - nor - estat vce - will "detect interactions". There is no such thing. What is more, there would be no purpose on this, since it is up to us to select - or not - interaction terms. On such grounds, provided our command is correct, Stata will, well, "detect" that we included an interaction in the model so as to perform the estimations accordingly. But, even so, we know this for sure, well before "quick-as-lightning" Stata realizes.
              Best regards,

              Marcos

              Comment


              • #8
                What does my output mean? @Cario

                Code:
                . estat vce, corr
                
                Correlation matrix of coefficients of cox model
                
                             |        1.        1.        1.        1.        1.        1.        1.        1.
                        e(V) | ttestf~s  agefor~t  gender~e        af  hypert~n       chf  hypoal~t  akifor~t 
                -------------+--------------------------------------------------------------------------------
                1.ttestfor~s |   1.0000                                                                       
                1.agefortt~t |   0.1665    1.0000                                                             
                1.gendercode |   0.1467    0.1662    1.0000                                                   
                        1.af |   0.0074   -0.2024   -0.2268    1.0000                                         
                1.hyperten~n |   0.1587   -0.0474    0.1496   -0.0330    1.0000                               
                       1.chf |  -0.1532   -0.1860    0.0415   -0.2974   -0.0074    1.0000                     
                1.hypoalbu~t |  -0.0144    0.0198    0.0653   -0.1002    0.1000   -0.0650    1.0000           
                1.akifortt~t |  -0.0720   -0.2801   -0.0226    0.1061   -0.1400   -0.0469   -0.1514    1.0000 
                1.poten~eddi |   0.1392   -0.0869    0.0635   -0.0581   -0.0752    0.0835   -0.0135   -0.2020 
                1.ttestind~n |  -0.0168   -0.4054   -0.2049   -0.0370   -0.0226    0.0246   -0.0273    0.0774 
                1.ttesttar~r |   0.0828    0.0028   -0.0233   -0.1914    0.1527   -0.0551    0.0803   -0.2055 
                1.afandwar~y |   0.0203   -0.0461    0.0016   -0.4261   -0.0059    0.0833    0.0247   -0.0247 
                1.non11orn~1 |   0.1176    0.1104    0.0184   -0.1686   -0.0939   -0.1379   -0.0128   -0.0741 
                1.nonaaorn~a |  -0.0444   -0.0803   -0.0533   -0.0590    0.0222   -0.0344    0.0291    0.0588 
                
                             |        1.        1.        1.        1.        1.        1.
                        e(V) | pot~eddi  ttesti~n  ttestt~r  afandw~y  non11o~1  nonaao~a 
                -------------+------------------------------------------------------------
                1.poten~eddi |   1.0000                                                   
                1.ttestind~n |   0.0101    1.0000                                         
                1.ttesttar~r |  -0.0134    0.6508    1.0000                               
                1.afandwar~y |  -0.0191    0.0975    0.0576    1.0000                     
                1.non11orn~1 |   0.1822    0.1101    0.0301    0.0696    1.0000           
                1.nonaaorn~a |   0.0517    0.0041   -0.0484   -0.0514   -0.0273    1.0000

                Comment


                • #9
                  Tom:
                  at a quick glance, it does not seem that your regression specification suffers from quasi-extreme multicollinearity.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment

                  Working...
                  X