Announcement

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

  • Generating survival curves for age groupsi vs stpm2 by p. Lambert

    Hello all.

    Stata can generate the following survival curves for particular age group with the following code eg this code is showing the survival curve for patients aged 30

    here the user is speciyimg ‘ i want the survival curve for someone aged 30’

    Code:
      
     stcox age ndrugtx site c.age#i.site, nohr strata(treat)  
    
     generate surv2 = surv0^exp( (-0.0336943*30+0.0364537*5)) label variable surv1 "long treatment" label variable surv2 "short treatment" line surv1 surv2 _t, sort ylab(0 .1 to 1) xlab(0 200 to 1200)  drop surv0-surv2
    source: https://stats.oarc.ucla.edu/stata/se...roportionality
    P. LAMBERT (in my opinion)

    TAKES this a step further with his stpm2 .
    using by graphing survival over 1 year as a function of ALL age groups.

    he predicts survival curves by placing all covariates at the MEAN as a function of age


    PRODUCING A PLOT EQUIVALENT TO THIS:


    source: https://pclambert.net/software/stpm2/stpm2_timevar/

    Question:
    A. Can one with the conventional stata commands produce graphs similar to P lamberts showing survival as a function of age RATHER than having to manually plot survival curves for different age groups, so if I want to show survival for age 30,40,60,70,80 - I would have to repeat the above code 5 times + another 5 for the other treatmenr (as treatment is a binary variable 0 or 1).

    B.
    is the stata method, manually plotting the graph for each age more accurate than p lamberts method of plotting a summative graph representing the survival as a function of age whilst setting other covariates at the mean ?

    c . If the stata method is more accurate than how do you plot a graph that will show the survival as a function OF ALL AGE GROUPS
    Last edited by Martin Imelda Borg; 10 Nov 2023, 23:58.
Working...
X