06-22-2013 10:51 AM
Given the following data, how would one create daily prism maps that show the cummulative number of thefts that have occurred in each state?
informat theftdate date9.;
input theftdate state thefts;
20jun2013 17 50
20jun2013 18 0
20jun2013 19 10
21jun2013 17 60
21jun2013 18 10
21jun2013 19 70
The states are fips codes, the thefts variable already represents the cummulative number of thefts, and the basic set of maps that I want to create are similar to:
proc gmap map=maps.us data=thefts (where=(TheftDate eq '20jun2013'd));
prism thefts / coutline=black discrete nolegend;
But .. I want to control the color of each state and I want each state's height to be the thefts' number on a scale from 0 to 5000.
Can that be done and, if so, how?
06-24-2013 08:43 AM
You can control the color of the land, and the height (and color) of the bars separately with a block map, but I don't think that's possible with a prism map (in a prism map, the height & color of the land would both be tied to 1 variable, I believe).
06-24-2013 09:20 AM
: I had cross-posted this to SAS-L and Joe Matise and Nat Wooding got me sufficiently close to what I am trying to do. It doesn't meet my specs 100%, but definitely comes close enough for my current need.
To keep the height standard across graphs I created a dummy fips code and assigned the maximum value to it.
I set the colors with pattern statements and then used area=state to assign the patterns.
Finally, I included a relzero option to have states with no data show zero frequencies.
set maps.us end=eof;
if eof then do;
proc gmap map=usmap data=theftsovertime (where=(TheftDate eq '01FEB2010'd));
prism thefts / coutline=black levels=all nolegend area=state relzero;