Hi -
I have a question on legend and pattern with PROC GMAP. Below is my code.
**************************************
proc format;
value color
0 = "No Patients"
1-5 = "1-5 Patients"
6-10 = "6-10 Patients"
11-20 = "11-20 Patients"
21-high = ">20 Patients"
;
run;
legend1 origin=(2,70)pct mode=share across=1 shape=bar(2,2) value=(height=1.5);
pattern1 v=ms c=white;
pattern2 v=ms c=grayca;
pattern3 v=ms c=yellow;
pattern4 v=ms c=orange;
pattern5 v=ms c=red;
proc gmap map=edmap.nys_zip_utm data=d&datarange all annotate=countyline;
id zip;
choro sum&i /discrete legend=legend1 coutline=black cempty=black;
format sum&i color.;
run;
**************************************************
Ideally, the map shows 5 colors (using defined 5 patterns) and the legend shows 5 categories. Hower, the problem is that whenever the dataset does not have the value for a category in "sum&i" (e.g., variable "sum&i" contains no values of 0) , the legend will only show 4 categories instead of 5, and the colors will also be wrong (e.g., category "1-5 Patients" will then be mapped white instead of grayca).
Does anybody know how to show all categories in the legend even if the data set does not have all category values? Thanks!