Hey @10134458! Here's how you can do it:
Look up the county ID from mapsgfk.us_counties_attr and attach it to your dataset
Add a hover-over HTML variable in the format needed by PROC GMAP
Create your PROC GMAP code and use the HTML option in the CHORO statement.
You can get the mapsgfk county IDs by merging your county data with it using DATA Step merge or SQL join, but in this case I'll choose to use a hash lookup.
At the bottom of this post is your data in CSV format.
data hospital_count2;
length id $10.;
set hospital_count;
/* Create a lookup table for the mapsgfk County ID for Ohio counties */
if(_N_ = 1) then do;
dcl hash lookup(dataset: "mapsgfk.us_counties_attr(where=(statecode='OH'))");
lookup.defineKey('county');
lookup.defineData('id');
lookup.defineDone();
end;
/* Get the mapsgfk county ID based on the state's county ID */
rc = lookup.Find();
/* Create a hover-over of info with a line break, '0D'x */
hover_over=cat('title="County: ', strip(county_name), '0D'x, 'Count: ', count, '"');
drop rc;
run;
proc gmap data = hospital_count2
map = mapsgfk.us_counties;
id id;
choro count / html=hover_over;
run;
Data:
county,county_name,Count
1,Adams,2
3,Allen,5
5,Ashland,1
7,Ashtabula,4
9,Athens,2
11,Auglaize,1
13,Belmont,3
15,Brown,1
17,Butler,5
19,Carroll,0
21,Champaign,1
23,Clark,3
25,Clermont,1
27,Clinton,1
29,Columbiana,2
31,Coshocton,1
33,Crawford,2
35,Cuyahoga,23
37,Darke,1
39,Defiance,3
41,Delaware,2
43,Erie,1
45,Fairfield,2
47,Fayette,2
49,Franklin,21
51,Fulton,1
53,Gallia,1
55,Geauga,1
57,Greene,2
59,Guernsey,2
61,Hamilton,18
63,Hancock,2
65,Hardin,1
67,Harrison,1
69,Henry,1
71,Highland,2
73,Hocking,1
75,Holmes,1
77,Huron,2
79,Jackson,1
81,Jefferson,2
83,Knox,1
85,Lake,2
87,Lawrence,1
89,Licking,1
91,Logan,1
93,Lorain,8
95,Lucas,16
97,Madison,1
99,Mahoning,6
101,Marion,1
103,Medina,2
105,Meigs,0
107,Mercer,1
109,Miami,2
111,Monroe,0
113,Montgomery,11
115,Morgan,0
117,Morrow,1
119,Muskingum,2
121,Noble,0
123,Ottawa,1
125,Paulding,1
127,Perry,0
129,Pickaway,2
131,Pike,1
133,Portage,1
135,Preble,0
137,Putnam,0
139,Richland,3
141,Ross,1
143,Sandusky,2
145,Scioto,2
147,Seneca,2
149,Shelby,1
151,Stark,6
153,Summit,11
155,Trumbull,5
157,Tuscarawas,2
159,Union,1
161,Van Wert,2
163,Vinton,0
165,Warren,2
167,Washington,2
169,Wayne,2
171,Williams,2
173,Wood,1
175,Wyandot,1
... View more