I am trying to create a colored map of counties using proc gmap. However, I am not able to get the colors using the following code (all counties are pale green). Please advise.
proc format;
value pop2016f
3972 - 50083 = '3972 - 50083'
50084 - 85881 = '50,083 - 85,881'
85882 - 234011 = '85,882 - 234,011'
234012 - 2606852 = '234,012 - 2,606,852'
;
run;
goptions cback=white border htitle=12pt htext=8pt;
pattern1 value=msolid color=vpag; /* abbreviation for very pale green */
pattern2 value=msolid color=vpab; /* abbreviation for very pale blue */
pattern3 value=msolid color=pink;
pattern4 value=msolid color=yellow;
proc gmap data=data_for_map map=MD all;
id county;
choro pop2016 / discrete anno=anno levels=4 coutline=black ;
format pop2016 pop2016f.;
run;
quit;
Thanks. It works by adding "missing" option The formats seem to be working. I will double-check if the chart numbers are correct.
I got the following warning with the previous code:
WARNING: Some observations were discarded when charting Total_Population_N (from Census. Only first matching observation was used. Use STATISTIC= option for summary statistics.
@monali wrote:
I am trying to create a colored map of counties using proc gmap. However, I am not able to get the colors using the following code (all counties are pale green). Please advise.
proc format;
value pop2016f
3972 - 50083 = '3972 - 50083'
50084 - 85881 = '50,083 - 85,881'
85882 - 234011 = '85,882 - 234,011'
234012 - 2606852 = '234,012 - 2,606,852'
;
run;
goptions cback=white border htitle=12pt htext=8pt;pattern1 value=msolid color=vpag; /* abbreviation for very pale green */
pattern2 value=msolid color=vpab; /* abbreviation for very pale blue */
pattern3 value=msolid color=pink;
pattern4 value=msolid color=yellow;
proc gmap data=data_for_map map=MD all;
id county;
choro pop2016 / discrete anno=anno levels=4 coutline=black ;
format pop2016 pop2016f.;
run;
quit;
If all of your colors are pale green then I would double check the range of values of your pop2016 variable in the data_for_map data set as the first step.
Are there any notes in the log?
Thanks. It works by adding "missing" option The formats seem to be working. I will double-check if the chart numbers are correct.
I got the following warning with the previous code:
WARNING: Some observations were discarded when charting Total_Population_N (from Census. Only first matching observation was used. Use STATISTIC= option for summary statistics.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.