Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: competing risk models


From   May Boggess <[email protected]>
To   [email protected]
Subject   Re: st: competing risk models
Date   17 May 2004 11:51:56 -0500

On Friday afternoon, Wesley Sine asked for help with 
analysing competing risks using a proportional hazards Cox model:

> I am trying to run a competing risks event history model using stata.  Once 
> firms enter the sample, they are at risk for three possible outcomes 
> (technology adoption).  I want to see if a list of various independent 
> variables affect the rate for these outcomes in different ways, maybe in 
> the same direction, but differential impact.  So in the output I should get 
> a set of coefficients (which I think decomposes to the probability of the 
> destination state * the overall rate) for each potential outcome.  In TDA, 
> the command is rate and then specify the outcome and independent variables 
> for each potential outcome (in my case 3 outcomes).  I would appreciate it 
> if someone could tell me how to do this with stcox?


As Enzo Coviello mentioned, there is a very nice paper by Lunn and
McNeil "Applying Cox regression to competing risks" Biometrics 51,
524-532, June 1995.  They go through a number of different methods.
There is also an FAQ on multiple failure survival data which mentions
a competing risk model:

http://www.stata.com/support/faqs/stat/stmfail.html

The FAQ method is not one of the methods that Lunn and McNeal mention.

Here I will give examples of the different methods. I am going to keep
it relatively simple by sticking to non-repeated failures, in other
words, each subject is either censored or suffers one event, which in
this example will be one of two types.

First I need to create an appropriate dataset. I will begin with the
following:

 clear
 sysuse cancer
 set seed 12345
 drop died
 gen id=_n
 move id st
 gen death=int(uniform()*3)
 list

Here death=0 is censored and 1 and 2 are the competing events.

For competing risks is that we need one record for each failure type for
each subject. This is the "expanded" dataset. Continuing where we left
off:

 expand 2
 bysort id : gen type = _n
 gen status=(type==death)
 recode type (1=0)(2=1)
 list, sepby(id)
 stset studytime, f(status) 

Now we have two records per subject and status is our failure variable.
For each subject, having two zeroes means censored. We have the
following choices for models:

 * risk type as covariate with interactions (Lunn & McNeal Method A) 
 gen aget=age*type
 gen drugt=drug*type
 stcox type drug age drugt aget, nolog nohr cluster(id)
 estimates store methodA

 * risk type as covariate with interactions only (Lunn & McNeal Table 2)
 stcox type  drugt aget, nolog nohr cluster(id)
 estimates store table2

 * risk type as strata (as in FAQ)
 stcox drug age, strata(type) nolog nohr cluster(id)
 estimates store faq

 * risk type as strata with interactions (Lunn & McNeal Method B)
 stcox drug age drugt aget, strata(type) nolog nohr cluster(id)
 estimates store methodB


I have saved the estimates from each of the models so that if I wanted
to compare them I could do so as follows:

 estimates table _all, stats(aic bic)

-- May
[email protected]



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index