Dear Statalist,
If I want to calculate the duration a person (using the ID in my example) spends within a phase (calculated from the start date of the current phase to the start date of the next phase), how can I do it?
I am very thankful for any advice on my questions
Code:
clear input int(ID date) float phase 1 17530 1 1 18756 1 1 19635 1 1 19853 2 1 21665 1 2 17535 1 2 18765 1 2 20111 2 2 22365 1 2 22789 2 3 18222 1 3 19356 2 3 20365 2 3 21489 3 3 21956 2 3 22050 2 4 15985 1 4 16896 1 4 18888 2 4 19653 2 4 20756 2 4 21666 1 4 22689 2 end format %tdDD/NN/CCYY date
If I want to calculate the duration a person (using the ID in my example) spends within a phase (calculated from the start date of the current phase to the start date of the next phase), how can I do it?
I am very thankful for any advice on my questions
Comment