Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
Klaus Pforr <kpforr@googlemail.com> |

To |
statalist <statalist@hsphsun2.harvard.edu> |

Subject |
st: competing risk discrete time survival analysis with nlogit |

Date |
Tue, 18 Jun 2013 21:23:57 +0200 |

<> Dear Listers,

This is my code to solve this. *********************************** * start *********************************** clear * set more off webuse hypoxia * for comparison if run the standard analysis given in the manual stset dftime, failure(failtype == 1) noisily stcrreg ifp tumsize pelnode, compete(failtype == 2) * now i go for the nlogit-solution * first i split the episode to have discrete time event history data * the choice of scale is arbitrary stset dftime, failure(failtype==1) id(stnum) scale(1) stsplit spell, every(1) * Outcome is defined

replace outcome=2 if failtype==1 /* Event of relapse of pelvic tumor */

label def out 1 "zens" 2 "local relapse" 3 "distant relapse" label val out out * Create index to mark "individual" choice sets for nlogit gen index=_n * Expand by number of outcomes expand 3 * Generate alternative-indicator bysort stnum spell: gen alternative=_n * Generate choice-indicator gen choice=outcome==alternative

gen zens=alternative==1 * Check if nest-structure is defined as supposed noisily nlogittree alternative zens , choice(choice) * Indicator for processtime quietly tab spell, gen(spnr) * Estimate the model * Version 1: Covariates come in at level of censoring vs. event/comp.risk * Note that I added 8 processtime-indicators

noisily esttab, keep(zens1:ifp zens1:tumsize zens1:pelnode ) unstack eform * Version2: Covariates come in at last level * Note that I added no processtime-indicators

*********************************** * end of code *********************************** Some additional notes on the models:

The questions that I have about this solution are:

Any comments are highly appreciated. best wishes Klaus -- __________________________________ Klaus Pforr GESIS -- Leibniz Institut für Sozialwissenschaft B2,1 Postfach 122155 D - 68072 Mannheim Tel: +49 621 1246 298 Fax: +49 621 1246 100 E-Mail: klaus.pforr@gesis.org <mailto:klaus.pforr@gesis.org> __________________________________ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

- Prev by Date:
**st: RE: RE: Reshaping to long format** - Next by Date:
**st: Panel Data Construction** - Previous by thread:
**st: Reshaping to long format** - Next by thread:
**st: Panel Data Construction** - Index(es):