Hello,
I am using the code from here: http://support.sas.com/kb/39/101.html
However, I need help modifying it--
using the sample data, supposed I had another variable denoting health-clinic. I need to produce the box plot for each clinic, so how can I modify the code to produce 50 graphs instead of one overall?
On these graphs, I also need a to add a reference point for that health-clinics unique value. (on the baseline plot and 15month plot, by measure (see sample data))
I.E. the 50 graphs (just like the one in Sample 39101) will be the exact same except for the unique markers for each practice.
Thank you!
SAMPLE DATA:
PracticeID ClinicName Measure ProportionBL Proportion15
6001 hdosnonds aspirin 0.786 0.897
6002 hskndon aspirin 0.638 0.579
6003 hdonwod aspirin 0.526 0.599
6001 hdosnonds bloodp 0.986 0.857
6002 hskndon bloodp 0.238 0.903
6003 hdonwod bloodp 0.436 0.822
That example is from 2010, SGPLOT now supports box plots, but not sure they're what you want.
An example is here:
https://support.sas.com/rnd/datavisualization/yourGraphs/analyticalQuick/vbox/
If you use SGPLOT then you can just add a BY statement for the CLINIC types to create a graph for each clinic.
Or try just adding a BY statement to the SGRENDER for clinics, It does seem to support BY group processing as well.
@aebabinec wrote:
Hello,
I am using the code from here: http://support.sas.com/kb/39/101.html
However, I need help modifying it--
using the sample data, supposed I had another variable denoting health-clinic. I need to produce the box plot for each clinic, so how can I modify the code to produce 50 graphs instead of one overall?
On these graphs, I also need a to add a reference point for that health-clinics unique value. (on the baseline plot and 15month plot, by measure (see sample data))
I.E. the 50 graphs (just like the one in Sample 39101) will be the exact same except for the unique markers for each practice.
Thank you!
SAMPLE DATA:
PracticeID ClinicName Measure ProportionBL Proportion15
6001 hdosnonds aspirin 0.786 0.897
6002 hskndon aspirin 0.638 0.579
6003 hdonwod aspirin 0.526 0.599
6001 hdosnonds bloodp 0.986 0.857
6002 hskndon bloodp 0.238 0.903
6003 hdonwod bloodp 0.436 0.822
@Reeza when I add the BY statement it only plots that clinics value (so I have one point for baseline and then one for 15 month)
any ideas? tahnk you for your help!
Yes, that's what happens when you say you want '50 graphs', ie one for each clinic. If that's not what you want, you need to be more specific.
It helps to show the code you are actually using. Referencing a source for similar code is nice but we can't tell what you may have implemented done that wasn't in the example.
By "unique marker" do you mean that you want 50 different markers such as different shape and color?
If you want 50 graphs, one per clinic then sort the data by clinic and add a by statement using the clinic variable.
Since the referenced code does not have a "baseline plot" or a "15month plot" your description is incomplete.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.