Hi everyone, I'm new to stata and I'm having trouble setting up my data for survival analyses.
Participants have up to 5 measurement waves. Let's say we have two variables that are measured at each wave: age and health. The event is death and we know their date of death (and thus the age at which they died).
If you take this person for example: he was 55,3 when he entered the study and he was 65,1 when he died. So the event took place between wave 4 and 5. At which wave do I say he has the event? Or do I have my data set up all wrong?
I will use age as a time-scale for the Cox regression, but I'm not sure how/where to include the age of the event (or censoring, since censoring due to loss to follow-up also occurs in between waves).
Participants can enter the study at different ages.
Can anyone help me to set up my data?
Participants have up to 5 measurement waves. Let's say we have two variables that are measured at each wave: age and health. The event is death and we know their date of death (and thus the age at which they died).
If you take this person for example: he was 55,3 when he entered the study and he was 65,1 when he died. So the event took place between wave 4 and 5. At which wave do I say he has the event? Or do I have my data set up all wrong?
I will use age as a time-scale for the Cox regression, but I'm not sure how/where to include the age of the event (or censoring, since censoring due to loss to follow-up also occurs in between waves).
Participants can enter the study at different ages.
id | wave | age | health status | died |
1 | 1 | 55,3 | 0 | |
1 | 2 | 58,7 | 1 | |
1 | 3 | 61,3 | 1 | |
1 | 4 | 64,5 | 2 | |
1 | 5 |
Can anyone help me to set up my data?
Comment