The attention of the world is now on Sochi and the Winter Games. Gold, Silver and Bronze medals are being earned by these amazing athletes, and everyone has an eye on the tally. Andre sent me a link to TRinker's R Blog, showing a graph of the current tally. Andre wanted to convey to SAS users this kind of a graph is easy to do in SAS, so he sent me the SAS data set of the latest tally. This data is in multi-column format, and I converted it to "Group" type structure as shown below.
A Lattice view of the graph as shown in TRinkers R Blog can be made using the SGPANEL procedure. Click on the graph for a high resolution view. I have intentionally ordered the countries by the number of GOLD medals, instead of Total. To keep the graph small, I only show countries with at least one Gold medal.
proc sgpanel data=sochi_group noautolegend; title 'Sochi Medals Counts by Country Ordered by Gold Medals'; panelby medal / layout=panel columns=4 onepanel sort=data novarname spacing=5; styleattrs datacontrastcolors=(gold silver %rgbhex(236, 143, 44) black); dot country / response=count group=medal nostatlabel markerattrs=(symbol=circlefilled size=10); rowaxis discreteorder=data display=(nolabel) fitpolicy=none; colaxis integer display=(nolabel); run;
While graphs like the one above are preferred by the statistical and analytical community, other users often want something spiffier. The nice thing about SG Procedures and GTL is that they can do both the analytical graphs and the spiffier graphs. Here is an example of what you can do with SAS 9.4 GTL. Click on the graph for a high resolution image.
SAS 9.4 GTL Graph of Sochi Medals:
This graph uses the following new features included in SAS 9.4M1 GTL:
- A SymbolImage statement allows usage of any image as a marker symbol. Here I have used the three medals.
- Alternate horizontal color bands allows easier decoding of the data.
- Backlit (or shadowed) text is used on the medals so it shows clearly.
Other graph configurations are possible and are included in the attached program.
Full SAS Program: Sochi