Announcement

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

  • stsplit for survival analysis

    Hello Statalist,

    This question is regarding survival data where subjects can potentially exit and re-enter observation multiple times before failure or censoring.

    The panel data are in long format with each observation ending in failure, censoring, or non-failure exit with subsequent re-entry. Each panel has a single origin date when the subject was first at risk (dc_date) and each observation has unique entry (t0) and exit dates (t1) for when the subject was under observation.

    I am using stsplit to stratify observations into risk levels by times of 0, 30, 60, 90 days from t0, which works well for the first (or only) observation in a panel.
    The problem I’m having is with “resetting” the stsplit at 0, so the splits begin counting from the t0 of the second (or subsequent) observations rather than study origin.

    I’ve tried multiple strategies, including: 1) changing the stset origin[] and enter[] variables and 2) creating a dummy variable “order” for observation sequence and using:

    stsplit [newvar] if (order==1), at (30 60 90 180 360) then
    stsplit [newvar] if (order==2), at (30 60 90 180 360)

    Regardless, I’m always ending up with the stsplist for observations after _n=1 counting from the panel origin date (dc_date) rather than from t0 of that observation.

    I appreciate any suggestions.

    thanks, Christy

  • #2
    I presume that you've read Mario Cleve's FAQ on multiple failure data.

    Please describe the study in more detail, including the outcome and the study question. You imply that a subject who left observation and then re-entered was at no risk of failure during the period before re-entry. Is that a correct interpretation? If the subject had not re-entered, wouldn't you have treated the exit as a censoring event?

    Please reread FAQ 12 and follow its instructions. Provide a sample of data with dataex as described in FAQ. Also, show all relevant code and results, including the stset statement you've tried so far, pasted between [CODE] and [/CODE] delimiters.

    I'll be unable to respond until next week, but hope that others will chime in.
    Last edited by Steve Samuels; 29 Aug 2018, 17:32.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Hmm. I see that subjects can experience only one failure; therefore Mario's FAQ is irrelevant to your problem. If, as I suspect, you would have censored a subject at exit if they did not return, then you should ignore exits followed by returns and censor subjects only at the time of last exit.
      Last edited by Steve Samuels; 29 Aug 2018, 21:07.
      Steve Samuels
      Statistical Consulting
      [email protected]

      Stata 14.2

      Comment


      • #4


        Rereading your post, I see that I was too quick to dismiss Mario's FAQ. I've misunderstood your question and I apologize.

        Your situation appears to be similar to that of Example 3.2.4 in the FAQ The conditional risk set model (time from the previous event). Your t0 (Mario's time0) should be 0 at the start of every "spell" (period starting with (re)entry and ending with an exit for any reason. The time variable for the spell is the length of the spell at exit. I assume that "order"at any time t the is number of spells the individual has had as of t, including the current one.

        My guess for an stsplit statement, assuming t0 = 0 for every spell, but not really knowing what you have done:

        Code:
        stsplit, at(30 60 90 180 360) after(time = t0)
        However, to be really sure, we would need an extract of your data with enough observations times and failures to do a simple stsplit (say at 90). To list the data, use datex, described in the FAQ . Show all code, including the original stset statement, between opening/closing delimiters [CODE] and[/CODE], described in the FAQ.
        Last edited by Steve Samuels; 06 Sep 2018, 09:56.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment

        Working...
        X