Hello,
Here is my issue:
I need to create a unique identifier for every 4 rows in my data.
It's current lay out has the following columns:
ID EncounterNumber Date systolic diastolic source and position
Systolic, diastolic, source, and position are given in alternating rows. For every blood pressure measured, it takes 4 rows to give the systolic, diastolic, source, and position. If I do the mod (n_,4) command it perfectly creates that a 0,1,2,3 sequence that matches consistently with systolic, diastolic, source, and position, but I want it all to merged in the same row.
ID and EncounterNumber are not unique to these values, a person may have had multiple blood pressures taken on one day, so I need to create a new identifier for every four rows so I can make into one row.
When I tried collapsing by date, ID, and EncounterNumber I lost many observations since there is overlap.
Thanks for any guidance on this issue.
Here is my issue:
I need to create a unique identifier for every 4 rows in my data.
It's current lay out has the following columns:
ID EncounterNumber Date systolic diastolic source and position
Systolic, diastolic, source, and position are given in alternating rows. For every blood pressure measured, it takes 4 rows to give the systolic, diastolic, source, and position. If I do the mod (n_,4) command it perfectly creates that a 0,1,2,3 sequence that matches consistently with systolic, diastolic, source, and position, but I want it all to merged in the same row.
ID and EncounterNumber are not unique to these values, a person may have had multiple blood pressures taken on one day, so I need to create a new identifier for every four rows so I can make into one row.
When I tried collapsing by date, ID, and EncounterNumber I lost many observations since there is overlap.
Thanks for any guidance on this issue.
Comment