Dear,
I am working on a data to produce a table. How to give the group names(eg:Rheumatic) in proc report to produce the table and the gap between each group. Thank you very much the great support.
data1
text NS\100 NS\200 NS\300
joint pains 10 20 30
knee pains 5 20 25
vomiting 3 6 40
nausea 30 20 26
headche 4 5 22
chest pain 20 20 30
Output table needed;
text NS\100 NS\200 NS\300
_________________________________________________________________
Cardiac
headche 4 5 22
chest pain 20 20 30
Rheumatic
Joint pains 10 20 30
knee pains 5 20 25
GE
vomiting 3 6 40
nausea 30 20 26
Create a format to group those values (and/or a look-up table to hold the "mapping").
Then apply the format/join with lookup table to ad the grouping information.
How do you know that Headache is Cardiac group? Normally, in the process of developing outputs from clinical data, the data will be coded using MedDRA coding. Generally this would be done by a automatic coding within the database, then reviewed by medics. It is not your job - and personally I wouldn't want to risk my neck - to define medical groupings of data, only to provide an output reflecting the groupings provided to you.
Thank you very much for the reply. In the data there is one variables(code) which has all the group names. Please help.
data1
text NS\100 NS\200 NS\300 code
joint pains 10 20 30 Rheumatic
knee pains 5 20 25 Rheumatic
vomiting 3 6 40 GE
nausea 30 20 26 GE
headche 4 5 22 Cardiac
chest pain 20 20 30 Cardicac
Output table needed;
text NS\100 NS\200 NS\300
_________________________________________________________________
Cardiac
headche 4 5 22
chest pain 20 20 30
Rheumatic
Joint pains 10 20 30
knee pains 5 20 25
GE
vomiting 3 6 40
nausea 30 20 26
Yes, so its a simple clinical table, your company should have loads of examples or you can check the Phuse Code library. I can't give exacts, however it is very simple, you count up subject by code, then you count up subject by code/text and set the two results together, then sort them into the order you want. You can do this in proc means/summary, or datastep, or proc sql. As a note, to get spaces in the output, i.e. to have headache indented a couple of spaces, put in you proc report:
define thevar / "a label" style={asis=on};
Otherwise the spaces will be removed and it will all be left aligned.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.