Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: How to draw cummulative incidence function of both events and competing-events on the same sheets?


From   Phil Clayton <philclayton@internode.on.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: How to draw cummulative incidence function of both events and competing-events on the same sheets?
Date   Mon, 23 Jan 2012 00:51:16 +1100

You haven't said whether you want adjusted curves or simply baseline CIFs - I'm assuming the latter. Let's say you have fictional data with survival time survtime and competing outcomes outcome==1 and outcome==2.

There are a couple of options:

1. Use -stcrreg- to calculate the baseline CIFs for the events of interest and then plot them. The manual entry for -stcrreg postestimation-, example 2, shows the basic idea.

stset survtime, fail(outcome==1)
stcrreg, compete(outcome==2)
predict cif_1, basecif
stset survtime, fail(outcome==2)
stcrreg, compete(outcome==1)
predict cif_2, basecif
line cif_* _t, sort c(J J) legend(order(1 "Outcome 1" 2 "Outcome 2"))

2. Use Enzo Coviello's -stcompet- from SSC. I generally find this faster and more convenient but the curves start at the first failure rather than at 0 - sometimes this looks a little messy in which case the -stcrreg- option is preferable.

stset survtime, fail(outcome==1)
stcompet cif=ci, compet1(2)
gen cif_1=cif if outcome==1
gen cif_2=cif if outcome==2
line cif_* _t, sort c(J J) legend(order(1 "Outcome 1" 2 "Outcome 2"))

Phil

On 22/01/2012, at 6:55 PM, kawakubo kazumichi wrote:

> Hello there, I'm trying to draw a graph of cummulative incidence function by using STATA11 (stcrreg, stcurve) But I can not draw a graph of both events and competing-events on the same sheets. Can I do this by STATA? Any help is much appreciated. Kazu  		 	   		  
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index