Announcement

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

  • Survival Function List - Cox Regression

    Hello,

    I am able to generate the survivor function overtime with the following code and associated output:
    sts list if fullcohort_rosey==1 & _weight==1, at(0 1 2 3 4 5) by(drug)

    failure _d: readmitdead_90 == 1
    analysis time _t: readmitdeaddays_90

    Beg. Survivor Std.
    Time Total Fail Function Error [95% Conf. Int.]
    -------------------------------------------------------------------------------
    drug1=0
    0 0 0 1.0000 . . .
    1 2692 23 0.9915 0.0018 0.9872 0.9943
    2 2666 17 0.9851 0.0023 0.9798 0.9891
    3 2647 25 0.9758 0.0030 0.9693 0.9810
    4 2621 10 0.9721 0.0032 0.9651 0.9777
    5 2610 15 0.9665 0.0035 0.9590 0.9727
    drug1=1
    0 0 0 1.0000 . . .
    1 2692 16 0.9941 0.0015 0.9903 0.9964
    2 2674 19 0.9870 0.0022 0.9819 0.9906
    3 2655 14 0.9818 0.0026 0.9760 0.9862
    4 2641 16 0.9758 0.0030 0.9693 0.9810
    5 2625 16 0.9699 0.0033 0.9627 0.9757
    -------------------------------------------------------------------------------



    However, I want to generate the same output/list in order to get the survival function overtime of the cox-hazard regression output. So I would like to generate a list of adjusted survival functions. I cannot seem to find a way to do this within the stcurve or stslist code. Does anyone have any suggestions?

    Thank you!!~

    Katie

  • #2
    -stcurve- has an -outfile()- option which will let you save the survival function to a new Stata data set. You can then -use- and -list- that file.

    Comment


    • #3
      Awesome!! got it!! Thank you!

      Comment


      • #4
        Clyde, I can see the survival function with outfile option. However, the data does not include the 95% confidence intervals or standard deviations. Do you know of any way to get (or calculate) that data?
        Thank you,
        Katie

        Comment


        • #5
          I'm afraid I don't see that as a saved output to any of the survival analysis commands I am familiar with. When I first learned survival analysis, I did learn how to calculate the standard errors of the survival function, but that is a long time ago and I have neither a memory of how to do it nor the textbook I used back then. I hope somebody else following along either knows how to calculate it or knows of a command that will give it to you.

          Comment


          • #6
            I don't know how to get what you want following a Cox model (although I imagine it should be possible). You can definitely get what you want after fitting a flexible parametric model using -stpm2- (available at SSC). See this tutorial for details.

            That tutorial is more advanced than what you actually need.

            If your cox model is

            Code:
            stcox x1 x2 x3
            then the corresponding code is something like

            Code:
            stpm2 x1 x2, scale(hazard) df(4) eform
            predict s, survival ci
            For each observation, the predicted survival will be in s with 95% confidence limits in s_lci and s_uci.

            Predictions will be very similar to the Cox model.


            Comment

            Working...
            X