Hi,
I have a dataset for some facility ID level, part of a given Ny state as below:
table have:
id Longitude Latitude Measure Cat Count_Fips_Code
1 -85.52972 33.10083 0.6 low 1
2 -87.165 31.57167 0.8 high 1
3 -85.4075 33.65056 0.5 medium 2
.....................................................
I need to map now these facilities and coloring it by category to see if any relation exists between cat and location. I was able to generate one map using proc gmap but the problem is
i had to aggregate measure based on Fips code( had to calculate avrg of measure for each Fips code previously) .
Any suggestion how to create this map in facility id level without aggregating step?
Thank you.
If you want to display markers at a specific point with different appearance such as color, shape or size of the marker then you are likely looking at an annotate approach. Create an annotate data set with the correct coordinates to match your map data and provide the marker appearance options desired.
One example is at https://support.sas.com/kb/24/906.html that provides different marker appearances for specific cities on a map.
Or https://robslink.com/SAS/Home.htm has 100's of example graphs with working code. Look at the mapping topics. Each page has a dozen or so pictures of maps. Find one that sort of resembles what you expect and follow the link(s) to the source code and data used for the shown map.
Here's one way to plot the facilities on a map, color-coded by 'cat'...
data foo;
length cat $10;
input id Longitude Latitude Measure Cat Count_Fips_Code;
datalines;
1 -85.52972 33.10083 0.6 low 1
3 -85.4075 33.65056 0.5 medium 2
2 -87.165 31.57167 0.8 high 1
;
run;
proc sgmap plotdata=foo;
openstreetmap;
scatter x=longitude y=latitude / group=cat
markerattrs=(symbol=circlefilled size=12px)
/* More current versions let you specify colors via colormodel=(cxd7191c yellow) */
;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.