BookmarkSubscribeRSS Feed
robertrao
Quartz | Level 8


hi Team,

I have counts(summarized for simplicity) of people who has diff diagnoses in different years

Year     Cancer       Aids    diabetics

2008     55              32           40

2009     100           90            44

2010      44            88             33  

How can I show graphically (boxplot) on the same page for comparison of the 3 years and 3 diagnoses as well

55     32      40                            100   90      44                                     44     88       33

can  aids  diabetes                    can  aids  diabetes                               can  aids  diabetes

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

2008                                                    2009                                                     2010  

Thanks           

1 REPLY 1
ballardw
Super User

Your task might be easier or more flexible by transforming the data so you have

Year Diagnosis where Diagnosis takes the values of Cancer, AIDS and Diabetes.

You also need something other than a count variable to create a box plot though. Something that makes sense to plot the mean/median and quartiles such as person'ts medical expense, length of stay in hospital, time between diagnosis and some other event or a biometric such as cholesterol level.

The procedure would be SGPANEL with code something like

proc sgpanel data=have;

     panelby year diagnosis /layout lattice;

     vbox <measure>; /* or hbox depending on how you want your boxes to run*/

or

     panelby year ;

     vbox <measure> /category=diagnosis;

run;

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1216 views
  • 0 likes
  • 2 in conversation