Hello,
I have data in wide format where every hospital visit is one line of data in a table entitled DAD2. The fields are: inst, chartno, acctno, disdate, dx1,dxtyp1, dxpre1, dxclus1,dx2, dxtyp2,dxpre2,dxclus2 etc. up to 25. How to I get the data to be in long format (in table Diagnoses):
inst
chartno
acctno
dx
dxtyp
dxpre
dxclus
I would also like to add occurrence number (which is the 1, 2 etc in the name above) as well as the total number of occurrences. Note that there is room to include 25 diagnoses so the "total_occur" field will represent the number of diagnoses for the record. How can I achieve this? Thanks.
Shelley
I have data in wide format where every hospital visit is one line of data in a table entitled DAD2. The fields are: inst, chartno, acctno, disdate, dx1,dxtyp1, dxpre1, dxclus1,dx2, dxtyp2,dxpre2,dxclus2 etc. up to 25. How to I get the data to be in long format (in table Diagnoses):
inst
chartno
acctno
dx
dxtyp
dxpre
dxclus
I would also like to add occurrence number (which is the 1, 2 etc in the name above) as well as the total number of occurrences. Note that there is room to include 25 diagnoses so the "total_occur" field will represent the number of diagnoses for the record. How can I achieve this? Thanks.
Shelley