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.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.