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

Hi,

 

I have a "Region_Location" on the X axis, and All HIV Cases, as wells reported HIV Cases which I want to be the frequency for the data, on the y axis. I would like to plot, for each location, the reported cases inside of a bar that has all the cases. So, for example, I can simply plot all the cases, for each region, like this:

 

Libname SasData '/folders/myfolders/SASData' ;  
      
Title "Reported AIDS Cases and All Estimated Persons Living with AIDS" ;

 

pattern1 value=empty ;
Proc gchart Data=SasData.HIV_Surveillance ;
Label   Residence_Location = 'Residence Location' ;
    Vbar Residence_Location / freq=All_Cases ;
run ;                       
quit ;

 

But I want to actually have, with a different pattern, pattern1 = empty, Pattern2 = R3, etc... the Reported cases inside the bar for all the cases. How do I do this. Nothing I have tried has worked so far . Thanks!

 

Below is the data file:

------------------------------------


/*HIV Surveillance Data 2014*/

Libname SasData '/folders/myfolders/SASData' ;
Data SasData.HIV_Surveillance ;
Input Residence_Location & $20.
      Reported_Cases     : 8.
      All_Cases          : 8. ;
Datalines ;
Atlanta         6355 14776
Baltimore       3490 10176
Boston          2769 9334
Chicago         5030 16037
Dallas          3312 9685
Detroit         1869 5289
Ft. Lauderdale  3218 9310
Houston         5034 13516
Los Angeles     7795 26799
Miami           4116 14399
Nassau          1190 3682
New Haven       873  4240
New Orleans     1558 4652   
New York        16046 66528
Newark          2435 7282
Orlando         1909 5555
Philadelphia    4150 14467
Phoenix         1756 4737
San Diego       1664 7327
San Francisco   2352 11264
San Juan        1829 6975
Tampa Bay       2118 6199
Washington DC   6440 19128
W.Palm Beach      1347 4991
;   

---------------------------------------

1 ACCEPTED SOLUTION
2 REPLIES 2
ManitobaMoose
Quartz | Level 8

SORRY.. THIS POST SHOULD READ: PLOTTING MULTIPLE BAR CHARTS INSIDE EACH OTHER If that is not possible, I could also plot them next to each other.

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
  • 2 replies
  • 818 views
  • 1 like
  • 2 in conversation