Announcement

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

  • Stset with durations

    Stset with durations.
    hello i have wide format data with different dates which i used to create different DURATIONS since the begining of observations.
    i am hesitating between 2 setup methods.
    To set up stata, i use the time duration until last news DURATION1 and as failure i use the duration until death for those who died DURATION2.
    So i do:
    stset DURATION1, fail(DURATION2)
    I had doubts so i tried another way.
    I use DURATION2 but i replace missing values for those who don't die by the value of DURATION1 and i create a dichotomous failure variable
    This leads to:
    stset DURATION2modified, fail(dead)


    The results are different and i am enclined to use the second method. Could anyone give me a feedback?
    thank you
    Mathieu

  • #2
    I'm unclear about your specific data organization, so I will say some general remarks, that you should supplement by reading closely the manual for stset by viewing the output of -help stset- and then clicking the link for the PDF documentation.

    - The -failure()- option takes a failure indicator (or something that can be evaluated as such) to indicate failure events vs censoring. The indicator takes on 1 (or more) values for events of interest, or 0 for censoring, and the time must correspond to either the earliest such time for events of interest, or else for censoring, the last known time the subject is free of an event.
    - Assuming you have just one observation per subject, then you can either calculate the duration to failure/censoring yourself by manually subtracting your time variables corresponding the beginning and ending of the period (t0 and t1, say). This way, we assume everyone starts at origin time=0. A second, and equivalent way, is the use the calendar date as your failure time (t1), and specify t0 in -origin()-. In the background, Stata calculates the difference between t1 and t0.

    Comment


    • #3
      Great thank you very much

      Comment

      Working...
      X