I hope this post finds you well !
The version of STATA being used is 14.2
The following is a glimpse of the data i am dealing with. In reality, there are much more variable
Region | Hospital_number | age |
1 | 1 | 18 |
1 | 1 | 25 |
1 | 2 | 30 |
1 | 2 | 45 |
1 | 2 | 34 |
1 | 2 | 50 |
2 | 3 | missing |
2 | 3 | missing |
2 | 4 | missing |
I want to generate a variable which gives numeric id to each patient within the hospital of a each region. From the data i know that in region 1, and hospital 1, there are 2 patients, and at hospital number 2, there are 4 patients.
When running the command egen patient_id=group(Hospital_number Region), the new variables basically displays the same data as Hospital_number.
I would be most obliged if anyone can help.
Kind Regards
0 Response to Trying to create a Unique Identifier for a Survey Data. (Have tried following other posts but nothing has worked)
Post a Comment