Announcement

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

  • stpm2 and predict with meansurv

    Hi Listers,

    I am running some survival analysis using stpm2 as I also plan to estimate relative survival. I am comparing survival across 2 groups so myexposure is disease status (yes/no). I also want to adjust my model for age, which I categorised into 6 groups. Both age and disease status are time-varying.

    I ideally would like to be able to plot survival across the 2 groups to observe any difference and I use the meansurv option to average across age group.

    The model runs fine and produces sensible hazard ratios; however, the plot is blank as the estimate survival rate is blank

    stpm2 BE_all agec2 agec3 agec4 agec5 agec6 , scale(hazard) df(4) eform tvc(BE_all agec2 agec3 agec4 agec5) dftvc(2)
    predict s1 , meansurv at(BE_all 0) timevar(_t)
    predict s2 , meansurv at(BE_all 1) timevar(_t)
    twoway (line s1 _t, sort) (line s2 _t, sort)

    Can anyone suggest what could be going wrong?

    Thank you
    Laura

  • #2
    Welcome to Statalist, Laura!
    You'll enhance your chance of getting good answers if you follow all the instructions in FAQ 12, which, in part , are to show not only everything you typed, but also what Stata responded, pasting all between CODE delimiter in the Forum editor.. Start with the stset statement, followed by stdes, then what you've already shown above.

    Your code looks correct to me. The first thing I ask to see after the above is the result of:
    Code:
     sum s1 s2

    Though not probably relevant to your question, the comand stpm2_standsurv (SSC), enhances the meansurv option of predict. You can get it with the command:
    Code:
    ssc install stpm2_standsurv
    Last edited by Steve Samuels; 20 Jun 2018, 15:58.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Thanks Steve and apologies for not posting any information about the output. I have now managed to resolve the issue now but I will also check out the -stpm2_standsurv- command you suggested.

      Is there a way to get an estimate of net survival at 1, 5 and 10 years within the stpm2 approach?

      Thanks again,
      Laura

      Comment


      • #4
        I've never tried this, but stpm2 can estimate relative survival models, which I assume are the same as "net survival" models. . See Lambert and Royson's Stata Journal article,. search in Stata for terms "net survival" and "relative survival" will turn up other references.
        Last edited by Steve Samuels; 21 Jun 2018, 15:47.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment


        • #5
          Thanks Steve!

          Comment

          Working...
          X