Announcement

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

  • conditional cumulative incidence functions under competing risk using age as time scale

    Dear All,

    I have recently read your paper entitled “Estimation and modeling of the restricted mean time lost in the presence of competing risks". I want to use the stpm2/stpm3 command to estimate the years of life lost under competing risk with attained age as time-scale. I first conduct cause-specific flexible parametric Royston-Parmar regression using stpm2/stpm3 for each outcome. I want to calculate the life expectancy at 40 years. So I need calculate the conditional cumulative incidence functions Fj,t0 (t)=Fj(t)/S(t0)= Pr(T < t, cause = j|T > t0). Then, the area under the curve can be estimated. I think that F1(t) + F2(t) + S(t) = 1, but some estimates are beyond 1. I am wondering if you could kindly share me with the statistical code. Bellows is some code.

    use https://www.pclambert.net/data/mgus2, clear
    drop if mspike == .
    gen age_exit = age + survtime
    tab event

    stset age_exit, failure(event=1) enter (age)
    stpm2 mspike male, scale(h) df(4)
    estimates store pcm1

    stset age_exit, failure(event=2) enter (age)
    stpm2 mspike male, scale(h) df(4)
    estimates store pcm2

    range tt40 40 100 61
    gen t40 = 40 in 1/61

    standsurv, crmodels(pcm1 pcm2) cif timevar(tt40) verbose at1(male 1) at2(male 0) atvar(F_male F_female)

    line F_male_pcm1 F_male_pcm2 tt40,sort
    line F_female_pcm1 F_female_pcm2 tt40,sort

    standsurv, crmodels(pcm1 pcm2) cif timevar(t40) verbose at1(male 1) at2(male 0) atvar(F_male40 F_female40)

    gen S40_male = 1 - F_male40_pcm1 - F_male40_pcm2
    gen S40_female = 1 - F_female40_pcm1 - F_female40_pcm2

    gen F_male_1 = F_male_pcm1 / S40_male
    gen F_male_2 = F_male_pcm2 / S40_male

    gen F_female_1 = F_female_pcm1 / S40_female
    gen F_female_2 = F_female_pcm2 / S40_female

    line F_male_1 F_male_2 tt40,sort
    line F_female_1 F_female_2 tt40,sort

Working...
X