Announcement

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

  • Stata code to generate Mean Cumulative Counts

    We have a cancer survivor cohort (approx 208 K) and we want to look at outcomes generated from hospital episodes (approx 3.9 million). We would like to generate some "mean cumulative counts" - which reflects a summarization of all events that occur in the population by a given time, not just the first event for each subject (see publication: Dong H, Robison LL, Leisenring WM, Martin LJ, Armstrong GT, Yasui Y. Estimating the burden of recurrent events in the presence of competing risks: the method of mean cumulative count. Am J Epidemiol. 2015;181(7):532-540. doi:10.1093/aje/kwu289). Is there any Stata code, programs, or functions that have been dedicated to this problem? A search with Dr Google has come up empty. Please note - I am not a statistician, just an IT Manager with colleagues who are banging their heads on walls in an effort to come up with a workable solution. Many thanks. Dave

  • #2
    Welcome to Statalist.

    Could you please try to explain what is the data management objective without making us read a whole paper?

    EDIT: For those who are interested to help, I found the R and SAS codes published by the author here, at the bottom of the page on: https://sites.ualberta.ca/~yyasui/software.html#MCC
    Last edited by Ken Chui; 22 Feb 2022, 11:28.

    Comment


    • #3
      David:
      welcome to this forum.
      An idea that crosses my mind after a quick glance at Table 2 of the paper you mention might be:
      Code:
      . input Prob_Event Surv_up_Tj Av_n_events Mean_Cum_Count
      
           Prob_Ev~t  Surv_up~j  Av_n_ev~s  Mean_Cu~t
        1. 0 1 0 .
        2. .25 1 .25 .
        3. .25 1 .25 .
        4. 0 1 0 .
        5. 0 .75 0 .
        6. 0.5 0.5 0.25 .
        7. 0.5 0.5 0.25 .
        8. 0 .5 0 .
        9. end
      
      . replace Mean_Cum_Count=sum( Av_n_events)
      (8 real changes made)
      
      . list
      
           +-------------------------------------------+
           | Prob_E~t   Surv_u~j   Av_n_e~s   Mean_C~t |
           |-------------------------------------------|
        1. |        0          1          0          0 |
        2. |      .25          1        .25        .25 |
        3. |      .25          1        .25         .5 |
        4. |        0          1          0         .5 |
        5. |        0        .75          0         .5 |
           |-------------------------------------------|
        6. |       .5         .5        .25        .75 |
        7. |       .5         .5        .25          1 |
        8. |        0         .5          0          1 |
           +-------------------------------------------+
      
      .
      Kind regards,
      Carlo
      (StataNow 18.5)

      Comment

      Working...
      X