Announcement

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

  • stpm2 estimate median survival from groups

    Hi all,

    Ok so I have built a survival using stpm2 and drawn some survival curves for different groups using predict x if y=1, meansurv ci

    The graphs are good and show the differing survival in my subgroups, but I would like to know the figures for the median predicted survival and CI in each group - how can I extract the numbers ? I can of course guesstimate them from the graph but I'd like to be more scientific than that!

    Many thanks,
    James

  • #2
    James,

    It is possible to obtain the median survival from predicted individual survival curves. For example, the following gives the median survival for each individual's predicted survival curve,
    Code:
    webuse brcancer, clear
    stset rectime, f(censrec==1) scale(365.25)
    stpm2 x5e hormon, df(5) scale(hazard)
    predict medsurv, centile(50)
    hist(medsurv)
    Note that you have to be careful in that for some covariate patterns your median survival may be based on extrapolation depending on the severity of the disease and amount of follow-up time.

    However, you have used the meansurv option. This gives a marginal estimate of the survival, i.e. for your, predict x if y==1, it will predict a survival curve for everyone for whom y==1 and then obtain the average of these survival functions. I see no easy way of getting the median survival for the marginal survival curve, at least how it is currently coded. Is it essential that you average over all individuals within your groups? Note that if the covariate distribution is different for each value of y, then the resulting curves are not adjusted for these differences. You would need to use the at() option in combination with meansurv to do this.

    Paul

    Comment


    • #3
      Hi Paul, Thanks for your answer and apologies for a very late reply - I got multiply side-tracked!

      Comment


      • #4
        Paul, a question for the if vs at point -
        Take the following example:

        Code:
        webuse brcancer, clear
        stset rectime, f(censrec==1) scale(365.25)
        stpm2 x5e hormon, df(5) scale(hazard) all
        
        
        predict h0_if_s if hormon==0, meansurv
        predict h1_if_s if hormon==1, meansurv
        predict h0_at_s, meansurv at(hormon 0)
        predict h1_at_s, meansurv at(hormon 1)
        
        twoway (line h0_if_s _t, sort) (line h0_at_s _t, sort) ///
                (line h1_if_s _t, sort) (line h1_at_s _t, sort)
        The resulting curves are very very close to each other but not quite identical - so what is the difference ?

        The reason I am using if in the first place is because I have more complex models where meansurv at() did not work as expected. i.e. I have included a variable C with a significant hazard ratio - yet if I visualise the survival curves for the cohort at C=0 or C=1 there is no difference between them (yet there should be according to the hazard ratio). Therefore I turned to the if approach instead which does show me distinct curves in those models. Why is it that the predict XX, meansurv at(C 0) or at(C 1) option does not show distinct curves in a complex model despite a significant hazard ratio for C? I have tried to replicate that using the brcancer example data but cannot.

        Comment


        • #5
          Actually I figured it out it was a coding error on my part, please ignore my last post
          James

          Comment

          Working...
          X