Announcement

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

  • How to account for multiple failures per ID in survival analysis using time varying covariates

    Hello, my last post didnt have any luck so i'm reframing and posting again with more useful info..
    Data example below:
    • we have ID, HPV straintype and visit number..followed by the HPV result at that visit and a clearance outcome..(which is 1 at first occurence of a negative result after a positive result). clear1enter is the enter variable and clear1futime is the time to clear1 or followup which i am using as the exit variable..
    • clearance is a strain specific outcome..so can have multiple outcomes of clearance per id.
    • The clearance var are only populated in certain windows as window is from the eligibility for clearance (first positive result) until clearance.
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input double(id strain_type visit) float(Result clear1 clear1enter clear1futime)
    10042 66  52 0 .    .    .
    10042 66  53 0 .    .    .
    10042 66  54 0 .    .    .
    10042 66  55 1 0    .    0
    10042 66  56 1 0    0  189
    10042 66  57 1 0  189  371
    10042 66  58 0 1  371  553
    10042 66  59 1 .    .    .
    10042 66  60 1 .    .    .
    10042 66  61 1 .    .    .
    10057 16  52 1 0    .    0
    10057 16  53 1 0    0  161
    10057 16  54 1 0  161  343
    10057 16  55 1 0  343  532
    10057 16  56 1 0  532  714
    10057 16  57 1 0  714  896
    10057 16  58 1 0  896 1078
    10057 16  59 1 0 1078 1260
    10057 16  60 1 0 1260 1442
    10057 16  61 1 0 1442 1638
    10057 16 102 1 0 1638 2912
    10057 16 103 1 0 2912 3276
    10057 52  52 0 .    .    .
    10057 52  53 1 0    .    0
    10057 52  54 0 1    0  182
    10057 52  55 0 .    .    .
    10057 52  56 0 .    .    .
    10057 52  57 0 .    .    .
    10057 52  58 0 .    .    .
    10057 52  59 0 .    .    .
    10057 52  60 0 .    .    .
    10057 52  61 0 .    .    .
    10057 52 102 0 .    .    .
    10057 52 103 0 .    .    .
    10069 16  52 0 .    .    .
    10069 16  53 0 .    .    .
    10069 16  54 0 .    .    .
    10069 16  55 1 0    .    0
    10069 16  56 0 1    0  182
    10069 16  57 1 .    .    .
    10069 16  58 1 .    .    .
    10069 16  59 0 .    .    .
    10069 16  60 0 .    .    .
    10069 16  61 1 .    .    .
    10069 59  52 1 0    .    0
    10069 59  53 1 0    0  168
    10069 59  54 1 0  168  350
    10069 59  55 1 0  350  532
    10069 59  56 1 0  532  714
    10069 59  57 1 0  714  896
    10069 59  58 1 0  896 1099
    10069 59  59 1 0 1099 1260
    10069 59  60 1 0 1260 1442
    10069 59  61 1 0 1442 1624
    10081 51  52 0 .    .    .
    10081 51  53 1 0    .    0
    10081 51  54 0 1    0  189
    10081 51  55 0 .    .    .
    10081 51  56 1 .    .    .
    10081 51  57 0 .    .    .
    10081 51  58 0 .    .    .
    10081 51  59 1 .    .    .
    10081 51  60 0 .    .    .
    10081 51  61 0 .    .    .
    10102 18  52 0 .    .    .
    10102 18  53 0 .    .    .
    10102 18  54 0 .    .    .
    10102 18  55 0 .    .    .
    10102 18  56 1 0    .    0
    10102 18  57 1 0    0  182
    10102 18  58 0 1  182  388
    10102 18  59 0 .    .    .
    10102 18  60 0 .    .    .
    10102 18  61 0 .    .    .
    10120 45  54 1 0    .    0
    10120 45  55 1 0    0  161
    10120 45  56 1 0  161  343
    10120 45  57 1 0  343  532
    10120 45  58 1 0  532  731
    10120 45  59 1 0  731  899
    10120 45  60 1 0  899 1032
    10120 45  61 1 0 1032 1242
    10120 45 102 0 1 1242 2481
    10120 45 103 0 .    .    .
    10136 58  52 1 0    .    0
    10136 58  53 1 0    0  165
    10136 58  54 1 0  165  333
    10136 58  55 1 0  333  508
    10136 58  56 0 1  508  690
    10136 58  57 0 .    .    .
    10136 58  58 1 .    .    .
    10136 58  59 0 .    .    .
    10136 58  60 0 .    .    .
    10136 58  61 1 .    .    .
    10339 56  54 0 .    .    .
    10339 56  55 0 .    .    .
    10339 56  57 0 .    .    .
    10339 56  58 0 .    .    .
    10339 56  59 1 0    .    0
    10339 56  60 1 0    0  182
    end
    i stset it using:
    Code:
     stset clear1futime, failure(clear1==1) scale(365.25) enter(clear1enter) exit(clear1futime)
    I read online that to account for multiple failures i should not use the id(id) option.

    my questions: 1) is my stsetting method right?
    2) because i didnt use id(id) while stseting, how do i account for the correlation by id? could cluster(id) as an option suffice when i run stcox?
    3) for time varying cov like current smoking/drinking etc, do i need to specify tvc? or something else? [ i have not included the time varying cov in the data example]

    Code:
    stcox gender, cluster(id)
Working...
X