BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sasuser31
Calcite | Level 5

I am trying to find a way to create a bar graph with mutiple disease types on it, while also grouping it by race. To do so (or at least how I know how to do it), I need a data set with the frequenceies of each disease type by race. I have variables Diseasetype1-Diseasetype10 and Race. I am hoping it will be something along the lines of creating a data set after a freq statement with all the disease types by all the race types?

 

I did this before just looking at the disease type as followed:

ods output onewayfreqs=diseasetables;

proc freq data=Disease;

tables diseasetype1 -- diseasetype10;

run;

 

Anyone have a solution that would be close to that but with disease crossed with race?

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Transpose your data and then try and use a graphing procedure.

 

Your data should be in the structure, as follows:

 

Race DiseaseCount Disease

race1 1 DA

race1 2 DB

race1 3 DC

....

 

 

Once your data is in this structure you should be good to use a variety of methods.

 

View solution in original post

1 REPLY 1
Reeza
Super User

Transpose your data and then try and use a graphing procedure.

 

Your data should be in the structure, as follows:

 

Race DiseaseCount Disease

race1 1 DA

race1 2 DB

race1 3 DC

....

 

 

Once your data is in this structure you should be good to use a variety of methods.

 

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
  • 1 reply
  • 569 views
  • 0 likes
  • 2 in conversation