I have a dataset with many variables that indicate people and certain characteristics, but several of them have the same identifier so they are in the same observation. I must separate each person in an observation of my own, but I have complicated a bit because not every identifier necessarily has the same number of people.
I have something like this
ID | Name_1 | Name_2 | Name_3 | Age_1 | Age_2 | Age_3 | Health_1 | Health_2 | Health_3 | Education_1 | Education_2 | Education_3 |
1 | Louis | George | 44 | 36 | 1 | 1 | 5 | 6 | ||||
2 | Sara | 27 | 2 | 6 | ||||||||
3 | Gary | Mary | Jhon | 53 | 23 | 12 | 1 | 2 | 1 | 7 | 4 | 3 |
4 | Renato | 45 | 1 | 7 |
ID | Number | Name | Age | Health | Education |
1 | 1 | Louis | 44 | 1 | 5 |
1 | 2 | George | 36 | 1 | 6 |
2 | 1 | Sara | 27 | 2 | 6 |
3 | 1 | Gary | 53 | 1 | 7 |
3 | 2 | Mary | 23 | 2 | 4 |
3 | 3 | Jhon | 12 | 1 | 3 |
4 | 1 | Renato | 45 | 1 | 7 |
0 Response to Separate observations depending on their value in one variable
Post a Comment