11-19-2015 04:01 PM
I am conducting a discreet time survival analysis using cloglog. I have 4 visits of data and I am trying to come up with a good way to remove observations after an event happens. For example, if the person get the event at time point 2, then their data should be deleted or missing for time points 3 and 4. Otherwise, their data will remain until the end of the study or until they experience the event. Any suggestions would be greatly appreciated. The outcome is a yes no variables, for example smoking: Yes No. If they initiated smoking at visit 2 then that participants data would be removed at subsequent visits.
11-19-2015 04:38 PM
Here's one idea:
if first.person then remove_the_rest='N';
if remove_the_rest='Y' then delete;
if smoking='Yes' then remove_the_rest='Y';
Of course, this assumes that your observations are sorted by PERSON ... logically you may need to sort by PERSON VISIT.