Convert multiple columns into one long row
Hey everyone,
I've done some extensive research and can't figure out how to do the
following:
I have multpiple rows/columns of data that reflect information for one
specific person. For one person, I end up with three-four different rows of
data. What I want to do is take these multiple records and put them all into
one long row for a single patient.
Basically, I want to take a layout like this:
Pt id drug value ldl value hdl
1 12 100 67
1 25 123 65
1 25 123 45
1 2 122 53
2 5 111 34
2 3 112 56
2 33 123 75
3 44 134 78
3 55 154 86
3 66 134 56
and convert it to something like this:
pt id drug value ldl hdl drug ldl hdl
1 12 100 67 25 123 65
2 5 111 34 3 112 56
3 44 134 78 55 154 86
Does anyone have any solutions for me? Your help is greatly appreciated.
|