Announcement

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

  • Aalen Johansen estimates of the cumulative incidence - how to include numbers at risk in figure

    Hi,
    In am using the Aalen Johansen estimator to plot the cumulative incidence of my specific outcome over time in the competing risk setting. The graph is shown below.


    For this graph, the journal requires that we include the number of individuals at risk at each of the 5-year age intervals displayed on the x-axis.
    In a normal Kaplan-Meier curve, the STATA syntax could easier provide me with such information using a syntax such as:
    Code:
    sts graph, by(group) risktable
    However, I am lost as to how I integrate the numbers at risk using this Aalen Johansen approach.

    Does anybody have experience with this and can guide me?

    A brief description of the STATA syntax that I have used to create the Aalen Johansen graph is displayed in the box below.

    Code:
    stset age, failure(event=1) id (id)
    
    stcompet CumInc_group1=ci if(group==1), compet1(2)
    stcompet CumInc_group2=ci if(group==2), compet1(2)
    stcompet CumInc_group3=ci if(group==3), compet1(2)
    
    gen CI_group1=CumInc_group1 if event==1
    gen CI_group2=CumInc_group2 if event==1
    gen CI_group3=CumInc_group3 if event==1
    
    sort age
    
    twoway (scatter CI_group1 age, connect(J))  ///
    (scatter CI_group2 age, connect(J)) ///
    (scatter CI_group3 age, connect(J))
    This syntax does not allow me to include the option 'risktable' as usually done in a Kaplan Meier figure.
    Any help would be much appreciated.
    Thank you,
    Line

  • #2
    Do you have the values (numbers at risk) at each point where you have an x-tick?

    Comment


    • #3
      This is a bit late, and is completely unhelpful to the OP, but I just want to thank the OP for his/her codes as I am quite new to stcompet (and stpm2 etc) and those codes allowed me to create a very nice graph and saved a lot of trial and error!

      Comment

      Working...
      X