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

st: stset for conditional risk set (multiple failure) models


From   Layna Mosley <[email protected]>
To   [email protected]
Subject   st: stset for conditional risk set (multiple failure) models
Date   Sun, 14 Aug 2005 18:54:36 -0400

I'm new to duration models generally and to repeated events models specifically. I'm having difficulty with getting the correct syntax for the stset command, so that I can then run a conditional risk set (gap time) model (as in Cleeves 1999).

My data are panel data (country-year format), with repeated failures. I have generated a sequence/stratification variable (to be used later in the analysis), as well as variables for overall time (by country), and conditional time (resetting the time count with each failure within the country). I also have -- although I perhaps don't need -- an "enter" variable, set to one for the first observation by country, and then reset to one in any period immediately after a failure.

My question is how to use this information with stset. The Cleeves article suggests
stset time,fail(status) exit(time .) enter(time0).

For my variables and data, I think this would mean

stset(duration), failure(turkredenom) id(countrynumber) exit(time .) enter (time0)
This model generates a probable error, though, and I'm guessing it's because the starting interval ends up as duration rather than as zero. It's also unclear to me how/whether to use the time0 option; the Stata documentation suggests it's "rarely used." At this point, I've just generated time0=0, but I'm sure that's wrong. And I'm not quite sure how to put together my variables into the stset commands. I'd appreciate any advice...these sorts of models don't seem widely used/documented.

Thanks!

Layna


. stset(duration), failure(turkredenom) id(countrynumber) exit(time .) enter (time0)

id: countrynumber
failure event: turkredenom != 0 & turkredenom < .
obs. time interval: (duration[_n-1], duration]
enter on or after: time time0
exit on or before: time .

------------------------------------------------------------------------------
5861 total obs.
719 multiple records at same instant PROBABLE ERROR
(duration[_n-1]==duration)
------------------------------------------------------------------------------
5142 obs. remaining, representing
160 subjects
18 failures in single failure-per-subject data
5142 total analysis time at risk, at risk from t = 0
earliest observed entry t = 0
last observed exit t = 44



*
* 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