BookmarkSubscribeRSS Feed
knveraraju91
Barite | Level 11

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

 

 

    

4 REPLIES 4
LinusH
Tourmaline | Level 20

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.

Data never sleeps
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

 

http://www.meddra.org/how-to-use/basics/hierarchy

knveraraju91
Barite | Level 11

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

RW9
Diamond | Level 26 RW9
Diamond | Level 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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1121 views
  • 1 like
  • 3 in conversation