Hi to you all
I am new to this forum and to STATA overall but so far I've managed to get along by browsing forums and using google. Now I have however come across a problem I just can't crack.
I have some data where ID is not unique as there can be several info of same ID. Let me be a bit more clear.
ID 1 pay "the" center a visit on date (xx.xx.xx) and has one observation that day (1) and the day after (2). Later that year (yy.yy.yy) the same person pay the center another visit and has again two observations with a days space (8+9). How can I group visit 1 and visit 2 uniquely?
ID date Group
1 | 1 | 1
1 | 2 | 1
1 | 8 | 2
1 | 9 | 2
2 | 2 | 1
2 | 3 | 1
2 | 8 | 2
2 | 7 | 2
3 | 2 | 1
3 | 4 | 1
3 | 10 | 2
3 | 11 | 2
I've tried using bysort but dates are not unique so I and up with no grouping at all.
In hope of some help
/Martin
I am new to this forum and to STATA overall but so far I've managed to get along by browsing forums and using google. Now I have however come across a problem I just can't crack.
I have some data where ID is not unique as there can be several info of same ID. Let me be a bit more clear.
ID 1 pay "the" center a visit on date (xx.xx.xx) and has one observation that day (1) and the day after (2). Later that year (yy.yy.yy) the same person pay the center another visit and has again two observations with a days space (8+9). How can I group visit 1 and visit 2 uniquely?
ID date Group
1 | 1 | 1
1 | 2 | 1
1 | 8 | 2
1 | 9 | 2
2 | 2 | 1
2 | 3 | 1
2 | 8 | 2
2 | 7 | 2
3 | 2 | 1
3 | 4 | 1
3 | 10 | 2
3 | 11 | 2
I've tried using bysort but dates are not unique so I and up with no grouping at all.
In hope of some help
/Martin
Comment