Programming the statistical procedures from SAS

BOX plot!

Reply
Super Contributor
Posts: 1,040

BOX plot!


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           

Grand Advisor
Posts: 10,062

Re: BOX plot!

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;

Ask a Question
Discussion stats
  • 1 reply
  • 142 views
  • 0 likes
  • 2 in conversation