Data visualization with SAS programming

PROC GMAP using maps.uscity

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

PROC GMAP using maps.uscity

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!


Accepted Solutions
Solution
3 weeks ago
Super User
Posts: 10,466

Re: PROC GMAP using maps.uscity

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.

View solution in original post


All Replies
Regular Contributor
Posts: 178

Re: PROC GMAP using maps.uscity

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;
Occasional Contributor
Posts: 12

Re: PROC GMAP using maps.uscity

That didn't seem to do it.  Here is an example of what my data in perfs looks like...

 

sample.jpg

 

This is completely made up - the place values don't match anything in CA - at least I don't believe so. 

 

Solution
3 weeks ago
Super User
Posts: 10,466

Re: PROC GMAP using maps.uscity

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.

Occasional Contributor
Posts: 12

Re: PROC GMAP using maps.uscity

Ah - I did not know that.  Thanks, that is exactly what I was looking for!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 185 views
  • 0 likes
  • 3 in conversation