I'm very new to boxplots and stored processes, ok with SAS base programming (using 9.2) and ok with WRS.
We have an idea to show data as box plots in WRS, I understand this can be done via stored processes. I would need to show 2 boxplots overlaid, for the following type of data:
I have 152 areas that make up Country data and I want to show the spread of data for the Country, but this data is also split into comparator groups which comprise of 18 of the areas in each group.
In WRS we will have a report for each area and I want to have a horizontal box plot with the data for the whole Country and the data for the comparator group for that area overlaid. I also want to add a marker to show the value for that council too.
What I need to work out is which of the proceedures in SAS will be best for this - if it's possible to do, how do I save it as a stored process and what listing menthod should I use? Any help in these areas would save me a great deal of trial and error time (as I'm a bit up against it timewise) and would be gratefully received.
We do show other data using the same set up (i.e. Area, it's comparator group and country data) in bar charts quite sucessfully in WRS
Per the traditional SAS boxplots (either using proc gplot with the box interpolation, or using proc boxplot), you might could overlay 2 of them using "proc greplay". You would want to make sure that the axes and all the text (titles, footnotes, axis text, etc) are exactly the same in both overlaid plots, so they will overlay in the exact same location - the only thing you'll want to be "different" is the boxplot itself).
Are you certain you want the 2 boxplots overlaid, rather than side-by-side?
Yes, the preference would be overlaid so that County, Comparator group and the value for the one Area can all be displayed together on one set of axes. Though if this proves too difficult then one on above the over could work just as well.
I've seen that you can create overlaid boxplots using proc template and begingraph, with layout = overlay, but this produces vertical plots. I've also seen that you can produce horizontal plots using ODS graphics and specifying the boxstyle as horizontal, but I haven't worked out how to do both horizontal and overlaid together yet. I'll have a look at proc greplay.
Yes, I will be creating 1 graph per Area, I'm hoping I can save it as a stored process so that I can add it to WRS ..... once I get the code to produce the plot I want working.
The report has Area as a group break and so I'm hoping to set it up so the WRS will feed the stored process with the Area parameter and then whichever Area is selected in the report it will contain a horizontal box plot with the values for England and then the values for comparator Areas on top of this and a marker to show where the Area value for that given Area lies. (this does seem like a tall order to me, but if SAS can do it then great!)
That's the vision anyway, I'm still at the stage of getting the base code to work in EG, I know I still need to think about my data structure and get that set up the right way to feed the graphs - just struggling for time at the minute
a quick update - I've got it working perfectly, I'm so grateful for your suggestion, the key thing that made a difference was the orient option in the boxplot statement for proc template, the rest was just getting my data into the right structure. The base code works a treat and I've had loads of fun playing with all the attribute options available in proc template to get it looking just how I want.
Now, just need to save it as a stored process and see if it works in WRS - look out for me scratching my head in the other forums ;-)