Announcement

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

  • Standard error for the Breslow estimator of the cumulative hazard.

    stcox's postestimation command predict allows the calculation of the Breslow estimates for the cumulative hazard (basechazard option), but not that of its standard error.

    I am wondering if someone has written some code to calculate it and, if so, if he or she is willing to share it.

  • #2
    Hello Andrea,

    I wonder whether this option (based on the FAQ from the site http://www.stata.com/support/faqs/st...seline-hazard/ ) applies to your neeeds:

    Code:
    . stset studytime, failure(died)
    
         failure event:  died != 0 & died < .
    obs. time interval:  (0, studytime]
     exit on or before:  failure
    
    ------------------------------------------------------------------------------
             48  total observations
              0  exclusions
    ------------------------------------------------------------------------------
             48  observations remaining, representing
             31  failures in single-record/single-failure data
            744  total analysis time at risk and under observation
                                                    at risk from t =         0
                                         earliest observed entry t =         0
                                              last observed exit t =        39
    
    . stcox drug age, nolog
    
             failure _d:  died
       analysis time _t:  studytime
    
    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)       =       36.29
    Log likelihood  =   -81.765061                  Prob > chi2      =      0.0000
    
    ------------------------------------------------------------------------------
              _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
            drug |   .2153648   .0676904    -4.89   0.000     .1163154    .3987605
             age |   1.116351   .0403379     3.05   0.002     1.040025    1.198279
    ------------------------------------------------------------------------------
    
    . predict hc0, basehc
    (17 missing values generated)
    
    . sum hc0
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
             hc0 |         31    .0069686    .0114544   .0004073   .0551102
    
    . tabstat hc0, statistics( mean sd semean )
    
        variable |      mean        sd  se(mean)
    -------------+------------------------------
             hc0 |  .0069686  .0114544  .0020573
    --------------------------------------------
    
    . predict mybasech, basechazard
    
    . sum mybasech
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
        mybasech |         48    .0349674    .0446204   .0006713   .1463072
    
    . tabstat mybasech, statistics( mean sd semean )
    
        variable |      mean        sd  se(mean)
    -------------+------------------------------
        mybasech |  .0349674  .0446204  .0064404
    --------------------------------------------
    Best,

    Marcos
    Last edited by Marcos Almeida; 10 Nov 2016, 03:28.
    Best regards,

    Marcos

    Comment


    • #3
      Thank you Marcos for your reply. Unfortunately, things are not that simple.

      I want to calculate the SE of the Breslow estimator of the cumulative hazard function. Formulas are presented for example here: http://support.sas.com/documentation..._details54.htm or in Therneau, Terry M., and Patricia M. Grambsch. Modeling survival data: extending the Cox model. Springer Science & Business Media, 2000 (page 267), in case you're interested.

      However, can you perhaps help me identify which ado-file implements the basechazard option of the predict command? I tried to trace back the ado file starting from stcox_p.ado but I got nowhere. Is it implemented in the built-in command cox, maybe? That would be really helpful to help me write the necessary code for the calculation of the SE without reinventing the wheel.
      Last edited by Andrea Discacciati; 10 Nov 2016, 07:35.

      Comment


      • #4
        Hello Andrea,

        This being so, it goes beyond my level of expertise. That said, after some browsing on the net, I found interesting stuff.

        By clicking on the links below, I gather you may eventually find what you are looking for:

        http://pauldickman.com/survival/strs.pdf

        http://www.pauldickman.com/rsmodel/stata_colon/

        http://www.pauldickman.com/rsmodel/s...ard_errors.pdf

        Hopefully that helps!

        Best,

        Marcos
        Best regards,

        Marcos

        Comment

        Working...
        X