Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72772

person-time at risk

$
0
0
Hi all

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
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

Viewing all articles
Browse latest Browse all 72772

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>