|
Greetings -
Having trouble figuring out how to achieve some control over what colors are
assigned to which levels in a choropleth map using PROC GMAP in SAS 8.xx.
Here's the situation. I rank individual states (using a US map) according to
some variable. There are 4 possible levels of the state ranking (call them A, B,
C, and D). I do this ranking in each of (say) 5 years. In some years, all of the
different ranks are represented (i.e., there is at least one state in each of
the 4 ranks). However, in other years, not all ranks are represented.
What I want to do is have the same color used for a given rank, relgardless of
what ranks are in the data set for a given year. At the moment, SAS/GRAPH is
making this hard to do (translation - I haven't figured out how to do it).
I've tried the following: setting PATTERN to be a specific color:
eg..,
PATTERN1 COLOR=RED;
PATTERN2 COLOR=BLUE;
PATTERN3 COLOR=BLACK;
PATTERN4 COLOR=GREEN;
What I want is for rank 1 = red, rank 2 = blue, rank 3 = black, and rank 4 =
green.
Now, if I plot the map for a given year that has all for ranks in the data set,
then it works fine. However, suppose in a given year I have only 3 ranks (say,
rank 2, rank 3 and rank 4). The map should in theory have only BLUE, BLAKC and
GREEN states. However, what SAS/GRAPH does is ALWAYS make the first level of the
ranks encountered RED, the second level blue, and so on. So,, instead of getting
BLUE (for rank 2), BLACK (for rank 3) and GREEN (for rank 4), I get RED (for
rank 2), BLUE (for rank 3), and BLACK (for rank 4).
Can anyone suggest a way around this? I realize I could simply recode the
PATTERNx states, running each year 1at a time, but that is extremely cumbersome.
I have 50 years, and would rather be able to run the program once, and correctly
have SAS/GRAPH permanently associate a pattern color with a given rank.
Thanks in advance...
|