Announcement

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

  • Problems with cumulative incidence graphs after using stcompet

    Hi

    I'm currently working on a project regarding prostate cancer (PC) specific mortality. I want to draw graphs that show the cumulative PC-mortality for 4 different timeperiods, stratified by agegroup and cancer-stage at diagnosis. Because death of other causes than PC is a competing risk to death of PC, I'm using stcompet. The cumulative incidence curves are then drawn using twoway line plots. My problem is, that all of the graphs look almost identical, indicating that the the cumulative PC-mortality is (almost entirely) the same for all agegroups and cancer-stages. (See attached photos. Sorry about the danish axis-titles. The x-axis is time since diagnosis, and the y-axis is the cumulative PC-mortality)

    This simply can't be right - so I must be doing something wrong. Here is the code:

    Code:
    generate Event = 0
    replace Event = 1 if Status == 1
    replace Event = 2 if DeathbyPC == 1
    replace Event = 3 if Status == 2 & DeathbyPC == 0
    replace Event = 4 if Status == 3
    label var Event "Status at 31/12/2013 - with cause of death"
    label define information  ///
      1 "Alive and living in the country 31/12/2013" 2 "Dead. PC cause of death" 3 "Dead by other causes than PC" ///
      4 "Immigrated"
    label value Event information
     
    stset Follow-up-time, failure(Event == 2) scale(365.25) id(PID)
    
    stcompet CumInc = ci, compet1(3) by(Year_diagnosis_cat)
    
    sort _t
    And below is the code that makes the graphs for the 50-64 year olds. The graphs for the two other agegroups were made the same way, changing Age_grp to 2 and 3 instead of 1.

    Code:
    quietly twoway ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Stage == 1 & Year_diagnosis_cat == 1960, ///
                      c(J) lpa(solid) lco(green) lpa(l)) ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Stage == 1 & Year_diagnosis_cat == 1990, ///
                      c(J) lpa(solid) lco(orange) lpa(2)) ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Stage == 1 & Year_diagnosis_cat == 1998, ///
                      c(J) lpa(solid) lco(red) lpa(3)) ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Stage == 1 & Year_diagnosis_cat == 2006, ///
                      c(J) lpa(solid) lco(yellow) lpa(4)) ///
     , name(p2_1, replace) nodraw xtitle("Tid siden diagnose") ytitle("Andel døde") title("Lokaliseret") ///
       legend (label(1 "1960-1989") ///                            
       label(2 "1990-1997")   ///                              
       label(3 "1998-2005") ///
       label(4 "2006-2013"))
      
    quietly twoway ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Stage == 2 & Year_diagnosis_cat == 1960, ///
                      c(J) lpa(solid) lco(green) lpa(l)) ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Stage == 2 & Year_diagnosis_cat == 1990, ///
                      c(J) lpa(solid) lco(orange) lpa(2)) ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Stage == 2 & Year_diagnosis_cat == 1998, ///
                      c(J) lpa(solid) lco(red) lpa(3)) ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Stage == 2 & Year_diagnosis_cat == 2006, ///
                      c(J) lpa(solid) lco(yellow) lpa(4)) ///
     , name(p2_2, replace) nodraw xtitle("Tid siden diagnose") ytitle("Andel døde") title("Regional") ///
       legend (label(1 "1960-1989") ///                            
       label(2 "1990-1997")   ///                              
       label(3 "1998-2005") ///
       label(4 "2006-2013"))
      
    quietly twoway ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Stage == 3 & Year_diagnosis_cat == 1960, ///
                      c(J) lpa(solid) lco(green) lpa(l)) ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Stage == 3 & Year_diagnosis_cat == 1990, ///
                      c(J) lpa(solid) lco(orange) lpa(2)) ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Stage == 3 & Year_diagnosis_cat == 1998, ///
                      c(J) lpa(solid) lco(red) lpa(3)) ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Stage == 3 & Year_diagnosis_cat == 2006, ///
                      c(J) lpa(solid) lco(yellow) lpa(4)) ///
     , name(p2_3, replace) nodraw xtitle("Tid siden diagnose") ytitle("Andel døde") title("Metastatisk") ///
       legend (label(1 "1960-1989") ///                            
       label(2 "1990-1997")   ///                              
       label(3 "1998-2005") ///
       label(4 "2006-2013"))
      
    quietly twoway ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Year_diagnosis_cat == 1960, ///
                      c(J) lpa(solid) lco(green) lpa(l)) ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Year_diagnosis_cat == 1960, ///
                      c(J) lpa(solid) lco(orange) lpa(2)) ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Year_diagnosis_cat == 1960, ///
                      c(J) lpa(solid) lco(red) lpa(3)) ///
     (line CumInc  _t if Event == 2 & _t<=15 & Age_grp == 1 & Year_diagnosis_cat == 1960, ///
                      c(J) lpa(solid) lco(yellow) lpa(4)) ///
     , name(p2_total, replace) nodraw xtitle("Tid siden diagnose") ytitle("Andel døde") title("Total") ///
       legend (label(1 "1960-1989") ///                            
       label(2 "1990-1997")   ///                              
       label(3 "1998-2005") ///
       label(4 "2006-2013"))
      
    grc1leg (p2_1 p2_2 p2_3 p2_total), name(p50_64_2, replace) legendfrom(p2_2)
    Can anyone tell me, whether or not any of the above explains, why the graphs look so similar, and what I'm possibly doing wrong?

    I'm using Stata 13.1 for Windows.

    Kind regards,
    Frederik

  • #2
    I can't immediately see anything wrong with your code, although I don't use stcompet very often so could easily miss something.

    The help file suggests "if you want graph functions relating to each event you need to type"
    . gen CumInc1 = CumInc if event==1
    . gen CumInc2 = CumInc if event==2

    and that's what I have always done. However, your code should do the same thing as far as I can see.

    I agree that the results are odd. In particular, I find it odd that the CIFs are similar for patients with localised and metastatic disease.

    In the lack of other insights, I suggest doing Kaplan-Meier graphs with failure(Event==2) just to ensure you see the expected results (e.g., better survival for localised) and then with "failure(Event==2,3)" (you should see better survival for younger patients). You could then check that the two CIFs from stcompet sum to (1 minus) the Kaplan-Meier estimate for all-cause survival. Hopefully that process will help identify the problem.

    Sorry I can't be more helpful.

    Comment


    • #3
      You have only asked stcompet to calculate different cumulative CIFs for different calendar periods by use of the "by(Year_diagnosis_cat)" option. When you plot the CIFs you plot these separately by age group, stage and calendar year, but the estimated CIFS will be identical within each age group/stage combination as you have not asked stcompet to calculate these separately. Add these groups to the by option in stcompet.

      Comment


      • #4
        Thank you both for your replies.

        Not calculating different cumulative CIFs for different stages and age groups, in deed seems to be the problem. Unfortunately, the stcompet-command doesn't seem to allow more than one variable in the by option.

        Code:
        stcompet CumInc = ci, compet1(3) by(Year_diagnosis_cat Stage Age_grp)
        When running this, I recieve the following error code:
        by(): too many variables specified
        r(103);
        Any idea on how to solve this?

        Comment


        • #5
          You can generate one variable reflecting the combinations of the three primary variables:
          Code:
          egen strat = group(Year_diagnosis_cat Stage Age_grp) , label

          Comment


          • #6
            That sorted it out - thank you. The results look way more realistic now.

            Comment

            Working...
            X