KEvin.xlsx I have a panel type data-set where the unit of analysis are incidents in a mental health center. So a mental health patient can have many incidents in the year. Some patients also have many entries to the health center (entry id and entry id date). I would like to know how many unique patients have more than one entry in my dataset. I already did this by my n1 variable (command not shown). So if the group have at least two different entry_id (or date), the group is coded as 1 otherwise 0 or missing, What I need now and couldn't do it my self if to count the numbers of entries per patients. Also the time order of my entry. For example I would like to then do analyisis only in patients 2 entry to the clinic. My last two columns is what I would need.
I would appreciate any help. I am also attaching a excel spreadsheet.
thank you,
Marvin
Incident | patient_id | Entry_id | entry_id_date | n1 | I need: # of entries | Ineed: Order of entries |
0018/15 | 00034448Y | 2411000000 | 9/26/2014 10:44 | 1 | 3 | 1 |
0130/15 | 00034448Y | 2411000000 | 9/26/2014 10:44 | 1 | 3 | 1 |
1427/15 | 00034448Y | 2411000000 | 9/26/2014 10:44 | 1 | 3 | 1 |
2440/15 | 00034448Y | 2411000000 | 9/26/2014 10:44 | 1 | 3 | 1 |
4125/15 | 00034448Y | 2411000000 | 9/26/2014 10:44 | 1 | 3 | 1 |
4892/15 | 00034448Y | 24110000025 | 10/26/2014 10:44 | 1 | 3 | 2 |
5131/15 | 00034448Y | 24111111 | 12/26/2014 10:44 | 1 | 3 | 3 |
1335/15 | 00035149J | 1132000000 | 3/24/2015 1:25 | 1 | 1 | |
0602/15 | 00035566Z | 3491000000 | 5/10/2014 1:44 | 1 | 2 | 1 |
3349/15 | 00035566Z | 3492000000 | 8/24/2015 12:31 | 1 | 2 | 2 |
4797/15 | 00035566Z | 3492000000 | 8/24/2015 12:31 | 1 | 2 | 2 |
0059/15 | 00036470Z | 3491000000 | 8/22/2014 6:13 | 0 | 1 | 1 |
0670/15 | 00036470Z | 3491000000 | 8/22/2014 6:13 | 0 | 1 | 1 |
I would appreciate any help. I am also attaching a excel spreadsheet.
thank you,
Marvin
Comment