<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Proc SGMap in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SGMap/m-p/923207#M363487</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using SAS 9.4. I have a dataset with zip code and ADI available. I am using the code below to map the location of each zip code and I would like to create a map that has a flag instead of bubble but in an ideal world I would also color code the flag based on ADI(a score from 0-100) and have the size of the flag representative of the frequency of that location.&amp;nbsp; For instance, zip code 24293 has 2 observations, so I would like this flag to be larger as there are 2 of them versus other zip codes with only 1 observation. I have been using the documentation from this website (chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/&lt;A href="https://support.sas.com/resources/papers/proceedings19/3314-2019.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings19/3314-2019.pdf&lt;/A&gt;) but I am not sure where to proceed. Any guidance is helpful. Thank you&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data locations;
	input zip national_Adi;
	datalines;
	28025	62
	28216	72
	28208	87
	72173	66
	23072	42
	27520	49
	27587	29
	23321	30
	20905	10
	27504	56
	22572	62
	72761	56
	66223	24
	78664	14
	24354	70
	24293	85
	24293	85
	23970	64
;

proc geocode data=locations out=locations2
	method=zip
	attribute_var=(national_Adi);
run;quit;

proc sgmap plotdata=locations2 maprespdata=locations2;
    openstreetmap;
    scatter x=x y=y / markerattrs=(size=10) datalabel=national_ADI datalabelattrs=(size=4);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 05 Apr 2024 16:28:24 GMT</pubDate>
    <dc:creator>GS2</dc:creator>
    <dc:date>2024-04-05T16:28:24Z</dc:date>
    <item>
      <title>Proc SGMap</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SGMap/m-p/923207#M363487</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using SAS 9.4. I have a dataset with zip code and ADI available. I am using the code below to map the location of each zip code and I would like to create a map that has a flag instead of bubble but in an ideal world I would also color code the flag based on ADI(a score from 0-100) and have the size of the flag representative of the frequency of that location.&amp;nbsp; For instance, zip code 24293 has 2 observations, so I would like this flag to be larger as there are 2 of them versus other zip codes with only 1 observation. I have been using the documentation from this website (chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/&lt;A href="https://support.sas.com/resources/papers/proceedings19/3314-2019.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings19/3314-2019.pdf&lt;/A&gt;) but I am not sure where to proceed. Any guidance is helpful. Thank you&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data locations;
	input zip national_Adi;
	datalines;
	28025	62
	28216	72
	28208	87
	72173	66
	23072	42
	27520	49
	27587	29
	23321	30
	20905	10
	27504	56
	22572	62
	72761	56
	66223	24
	78664	14
	24354	70
	24293	85
	24293	85
	23970	64
;

proc geocode data=locations out=locations2
	method=zip
	attribute_var=(national_Adi);
run;quit;

proc sgmap plotdata=locations2 maprespdata=locations2;
    openstreetmap;
    scatter x=x y=y / markerattrs=(size=10) datalabel=national_ADI datalabelattrs=(size=4);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Apr 2024 16:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SGMap/m-p/923207#M363487</guid>
      <dc:creator>GS2</dc:creator>
      <dc:date>2024-04-05T16:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SGMap</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SGMap/m-p/923228#M363492</link>
      <description>&lt;P&gt;Since you want to change a symbol based on the count of something I would suggest summarizing your data to get that count as variable. Then you could change the size based on that value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With a non-standard symbol, such as "flag" I would suggest finding a unicode character of a basic flag and then using one of the example text plots using unicode as appear on &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2021/10/22/how-to-mislabel-a-map/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2021/10/22/how-to-mislabel-a-map/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The SGMAP Text statement will allow using a COLORRESPONSE statement to use the value of a variable to change the color. The COLORMODEL will work with that variable to assign specific color ranges.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 18:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SGMap/m-p/923228#M363492</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-05T18:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SGMap</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SGMap/m-p/923274#M363510</link>
      <description>&lt;P&gt;You could use BUBBLE statement instead of SCATTER.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data locations;
	input zip national_Adi;
	datalines;
	28025	62
	28216	72
	28208	87
	72173	66
	23072	42
	27520	49
	27587	29
	23321	30
	20905	10
	27504	56
	22572	62
	72761	56
	66223	24
	78664	14
	24354	70
	24293	85
	24293	85
	23970	64
;


proc geocode data=locations out=locations2
	method=zip
	attribute_var=(national_Adi);
run;quit;


proc freq data=locations noprint;
table zip*national_Adi/out=_count;
run;
proc sort data=locations2;by zip national_Adi;run;
data locations3;
 merge locations2 _count;
by zip national_Adi ;
run;
proc sgmap plotdata=locations3 maprespdata=locations3;
    openstreetmap;
    bubble x=x y=y size=count/ datalabel=national_ADI datalabelattrs=(size=4);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1712382944999.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95266iEF6EB94CA2BCE182/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1712382944999.png" alt="Ksharp_0-1712382944999.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 05:56:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SGMap/m-p/923274#M363510</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-04-06T05:56:09Z</dc:date>
    </item>
  </channel>
</rss>

