I am to work with some data that has been inputted in SPSS in a rather
unusual format. Transferring from SPSS into Stata is not the problem -
rearranging the data into a format I am comfortable with is. At the
moment it looks something like this:
id date time person_id Gender Injury
1 21/1/2005 23:10 1 M Face
. . . 2 M Head
. . . 3 F Legs
2 23/1/2005 04:15 1 M Arms
. . . 2 F Feet
3 23/1/2006 05:10 1 F Face
The data refers to violent incidents in a particular area. For each
incident more than one person (the maximum is somewhere around 6 but
could go higher as new data arrives) may have been involved each
sustaining different injuries.
I would like to rearrange these data into a form something like this:
id date time gender1 injury 1 gender2 injury2 ...
As far as I can see -collapse- will not help me much. So, has anyone
had experience with this type of problem and could you point me in the
right direction?