Hi all
I have the following dataset.
I want to calculate the person-time at risk on this dataset.
My calculation by hand is "the number of days between 1/2/2013 and 10/2/2013 =9 + the number of days between 4/2/2013 and 15/2/2013 =11 +the number of days between 2/3/2013 and 9/2/2013 =7), so in total, the amount of person time at risk is 9+11+7 = 27
Just wondering how to calculate that by using stata?
Many thanks
I have the following dataset.
ID | Date |
1 | 1/2/2013 |
1 | 4/2/2013 |
1 | 9/2/2013 |
1 | 10/2/2013 |
2 | 4/2/2013 |
2 | 9/2/2013 |
2 | 15/2/2013 |
2 | 19/2/2013 |
3 | 2/3/2013 |
3 | 9/3/2013 |
My calculation by hand is "the number of days between 1/2/2013 and 10/2/2013 =9 + the number of days between 4/2/2013 and 15/2/2013 =11 +the number of days between 2/3/2013 and 9/2/2013 =7), so in total, the amount of person time at risk is 9+11+7 = 27
Just wondering how to calculate that by using stata?
Many thanks