Robert Allison's SAS/Graphic Examples - cd #3 Created: February, 2004 To view these examples, view the "aaaindex.htm" file in an IE browser. ^^^^^^^^^^^^ Similar to my democd1 - here are some more great sas graphics examples. This time, the emphasis is on graphics for demographic data. Most of these examples will work at v8.2, but I do include a few v9 tricks to demonstrate them (such as the new zipcity function). Here's how I chose these examples... I got a copy of the February 2004 "American Demographics" magazine. And, for each of the graphs and maps in this magazine I tried to use sas to create a sas imitation (where possible, an 'exact' imitation). Here's how these examples might be useful... Since SAS runs a full-page inside-cover ad in 'American Demographics' (AD) that must mean that we think AD readers are potential SAS customers. If AD readers find the AD graphs useful, they should also be interested to know that they can use SAS to produce graphs like this. If we can *show* these potential customers that SAS can produce these graphs (rather than just tell them) they will be impressed. Also, if American Demographics sees that SAS can be used to produce the types of graphs & maps they use in their magazine, maybe they'd be interested in using SAS to do their graphics(?) That would make a very nice/visible use of SAS, which would help gain exposure for our graphics capabilities. Also, these are very nice demographic graphics examples - anyone who might be interested in demographics might also be interested in knowing that sas/graph can do these kinds of graphics. Also, the Census (one of our biggest customers) might be interested in these examples! ----- Special Notes: Note that the map examples were created using sas/graph (proc gmap), not sas/gis! I recommend IE rather than netscape because netscape does not support the html alt= flyover text, which many examples uses. Hopefully these examples show that sas graphics software can do "Just about anything", and the sas code will provide a good starting-point for sas users who are wanting to create similar graphics. Some other graphics software might be easier to use than sas, but sas graphics gives you the flexibility and power to produce almost *any* kind of custom graphics you want - and this can be done programmatically so the production of new/updated graphics can be easily generalized and automated (whereas most other 'easy-to-use' graphics software only provide a GUI-based interfaces and you have to keep manually re-creating their graphics over and over.) In addition to showing the sas graphics capabilities, some of these examples also make use of sas "ods html" capability, which provides chart-tip flyover text, drilldowns, hotspots, borders, and other ods style capabilities. Note that I've set up many of the drilldowns such that they tie in to the actual/real web pages out on the web. These examples were created using v9 sas on a Windows PC. They should all be able to run using v8.2 and higher sas, and they should run ok on Unix also (unix doesn't have all the fonts, such as "arial", therefore you might have to try changing the fonts and font sizes to get them to look good on unix). Also, if you leave out the "ods html" stuff, and the html= drilldown stuff, you should be able to get most of the graphs and maps to run in v6 sas as well :) All of the code for these examples was written by Robert Allison. These examples (intentionally) look very much like the graphs in 'American Demographics', but the examples and sas code used here were totally written from scratch (ie, no code was "borrowed" or "stolen" - it was all written totally from scratch by Robert Allison). Be aware that the data used in these examples should all be considered as contrived/non-accurate data. In most cases the values were just 'eyeballed' from the original graph, and in some cases the data are just totally random/contrived. The examples were designed to look "plausibly real", but please do not rely on the data values as being correct! Robert E. Allison, Jr., PhD Cary, NC 27513 voice: xxx-xxx-xxxx fax: yyy-yyy-yyyy email: robincary@gmail.com v3.0 - initial version 13may2004 Made correction to annotate variables in media.sas, higher.sas, and sponsor.sas Previously I was using 'y=' where I should have used 'x=' (this produced annotation that looked ok because annotate picks good defaults, but was not technically correct.) 27may2004 Enhanced several examples to use the "arial" hardware font, and adjusted my pc's settings such that it would draw the characters with anti-aliasing (smoothing of edges). ----- And, the standard disclaimers... This software is being provided "AS IS" without any express or implied warranties. SAS Institute Inc. is not liable for any damages caused by the use of this software. -----