Announcement

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

  • Setup data correctly for survival analysis - stset - without losing observations

    Dear all, i was hoping someone might be able to help me set up my data correctly so i can use it in a survival analysis.
    My dataset is persons, who have become unemployed and want to make a survival analysis where it measures the time from they become unemployed until they reach employment. I have set the maximum time to 24 months (so if they havent reach employment after 24 months, they dont succeed). There are some observations in my data, which are right-censored, meaning that from the time they are unemployed they at some point die/move/retire, for these observations time is measured from unemployment until they ''leave''. Persons can enter several times, as they can enter as soon as they have reach employment (then they will enter if they again reach unemployment).

    pnr= ID variable
    suc =reach succes(employment)
    tid=time for reaching employment/are being right-censored

    An example of my data:
    PNR SUC(reach employment) right-censored TID(measured in months)
    1 0 0 24
    1 0 0 24
    2 1 0 5
    2 0 1 7
    3 1 0 0
    etc.

    i tried the following command, but get this:

    Click image for larger version

Name:	Udklip.PNG
Views:	1
Size:	68.7 KB
ID:	1557948


    how do i edit my data so all records are included and why do i get the two messages:
    ''multiple records at same instant'' and ''observations begin on or after (first failure)''

    the message ''observation end on or before enter()'' - i understand is because i have person who reach employment (suc=1) but at time =0. I read a solution would be to just edit these time to fx tid=0.1 - would that be dangerous?

    I hope somebody can help.

    Best regards Julia
    Attached Files

  • #2
    Have a look at slides 7 to 9 in the following; it describes what I believe is the exact same setup as your study.

    https://www.stata.com/meeting/italy1...8_Ghilotti.pdf

    That presentation shows both how to set up the data and how to analyse them. There are also examples in the help (under "multiple record per subject survival data).
    Last edited by Paul Dickman; 10 Jun 2020, 02:58.

    Comment


    • #3
      Thank you - i think i figured it out

      Comment

      Working...
      X