Announcement

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

  • categorical outcome for first occuring event

    Dear stalisters,

    I am performing an event history analysis using a multinomial model (competing risk).

    The failure event is low wage=0. I want to know if the individual exits to higher wage or to unemployment (in the first exit) or if the individual stays in constant lowwage for all years (hence three different outcomes).
    Data still exists for the subsequent years after exiting, hence I cannot only recode outcome=0 if unemployment=1, I only want the outcome to be exit to unemployment if duration to that type of exit is shorter than to the other possible exit.

    furthermore, as it is event history the id drops out after exiting, hence I want the outcome to occur on the right time when low wage is no longer 1.

    When coding my outcome variable I end up in a very long and complicated code involving more than five different steps inclusing first event, durations, recoding to missing if something else is one, lagged variables etc. It is a mess. There must be a simpler way to do this.


    Anyone that have any coding suggestions?

    id year lowwage highwage unemp
    1 2000 1 0 0
    1 2001 0 1 0
    1 2002 0 0 1
    1 2003 1 0 0
    2 2000 1 0 0
    2 2001 1 0 0
    2 2002 0 0 1
    2 2003 1 0 0
    3 2000 1 0 0
    3 2001 1 0 0
    3 2002 1 0 0
    3 2003 0 0 1
    best, Karin
    Last edited by karin kristensson; 14 Jan 2022, 04:43.

  • #2
    or actually I may just tell stata to do this in using the stset command , low wage =0 unemploy=1 2=higher wage, and stset will sort it out with the timing of events.

    Comment


    • #3
      Few people in this forum deal with survival-time data, but you can still get help with coding. It is unclear what you want from #1. My advice is that you create an example dataset with a wanted variable that you have entered manually. Present this using the dataex command as recommended in FAQ Advice #12.

      Comment


      • #4
        https://www.stata.com/support/faqs/d...t-occurrences/ may help.

        Comment


        • #5
          Thank you everyone for your replies!

          It all helped, but the method explained in this old post was most helpful for solving my problem, https://www.stata.com/statalist/arch.../msg00286.html. Combined with this strategy for the outcome https://www.statalist.org/forums/for...-error-message. So if anyone is in this thread with the same problem I solved it by coding the min year for the different events than generating an outcome based on this approach: replace failure_var = 2 if event== 1 & time_event < time_event2

          Comment

          Working...
          X