It has been many years since I've used GMAP and I've never used the uscity data set. I want to display a count of providers per city in a particular state. I don't get errors and I can see the legend but the map does not appear. I'm sure there is some basic thing I'm missing. This is my code...
proc gmap data=PERFS
MAP=MAPS.uscity ALL;
WHERE STATECODE = 'CA';
ID STATE PLACE;
CHORO PERFS/COUTLINE=BLACK;
RUN;
QUIT;
My data set called perfs contains 5 variables.
City = name of the city
Statecode = 2 alphas for the state (e.g. CA for California)
perfs = number of perfs in the city
state = numeric fips code for state (e.g. 1 for Alabama)
place = place variable merged in from maps.uscity based on state and city
Any direction is much appreciated. If helpful, I'm using SAS v9.3 in the windows environment. Thanks!
Maps.UScity is a feature data set. It does not contain state boundaries. So that may be part of the issue. The values (counts) associated with cities would be in an annotate data set.
On this page, http://robslink.com/SAS/democd44/aaaindex.htm , there is a link to Example 12. Cities that shows placing total values for a few cities on a US map.
It's a bit difficult to be certain without seeing some data from PERFS but I suspect the problem might lie with your where clause - try this
proc gmap data=PERFS MAP=MAPS.uscity(WHERE STATECODE = 'CA') ALL; ID STATE PLACE; CHORO PERFS/COUTLINE=BLACK; RUN; QUIT;
That didn't seem to do it. Here is an example of what my data in perfs looks like...
This is completely made up - the place values don't match anything in CA - at least I don't believe so.
Maps.UScity is a feature data set. It does not contain state boundaries. So that may be part of the issue. The values (counts) associated with cities would be in an annotate data set.
On this page, http://robslink.com/SAS/democd44/aaaindex.htm , there is a link to Example 12. Cities that shows placing total values for a few cities on a US map.
Ah - I did not know that. Thanks, that is exactly what I was looking for!
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.