I am using survival analysis to analyse the time-to-an-event (relationship failure). Each person becomes at risk (of failure) from the time they enter into a relationship with someone else, and this is shown by a variable 'begin' (when begin == 1) in the year this occurs. Relationship failure is shown by a break-up (end == 1) in the year this occurs. I am working with panel data so have multiple observations for each individual (in a couple) and each individual has an ID (I used -group()- to create a couple ID).
My panel data set contains observations that are right-censored (where the event did not occur over the survey period or due to a subject not continuing with the survey) and left-truncated (where two individuals were already a couple (and therefore 'at risk') prior to the first wave of the survey).
I originally had:
Code:
stset seq, id(couple) failure(end==1) enter(begin==1 exit(time .)
Code:
stset seq, id(couple) failure(end==1) time0(begin) origin(begin==1) exit(time .)
Note: 'seq' is the sequence of years that a couple is together, increasing from 1 in the wave they first become a couple.
Stata v.15.1.
0 Response to stset has a number of options, advice on which are key to test my time to event analysis?
Post a Comment