Hi Mike- I found your code to LinLin very helpful for my own analysis. However, I am having problems with a few parts of the code and am wondering if you can help by explaining your code a bit more - if you have time. I made the following changes to LinLin's code: 1. Used dots instead of stars as the symbols 2. Kept dot size the same regardless of how many are located at the same zip code. 3. If one zip code has more than one in the same location, then use a "2+" for the text label. Otherwise, leave the txt blank. 4. Subset this larger map into two maps (i.e. 1 map has only points for gnd1=1 and gnd2=0 and another map is where gnd2=2 and gnd1=0); Knowing those changes, I have made some modifications to your code to LinLin. (See below.) However, I am still having issues with point 3 and 4. On point 3, I cannot get the text to say "2+" for those that have 2+ at the same location (and there are a handful.) Can you please review my code below and see where I am going wrong? Right now, I am getting a '1' label on every dot. On point 4, I cannot seem to figure out how to subset the maps using the when statements. I know that I can subset my data in the earlier steps, but was hoping to be more efficient and do it all in one code. Thank you! If you don't have time, that's just fine! I'm just reaching my end by trying to figure these smaller points out. data anno; retain xsys ysys '2' hsys '3' function 'label' style 'wingdings' text '8c'x size 6 when 'a'; set pfriends; /*size = ifn(nfriends lt 3, nfriends, 3)*/; select; when (gnd1 and not gnd2) color = 'green'; when (gnd2 and not gnd1) color = 'blue'; otherwise color = 'red'; end; if nfriends gt 1 then txt = '2+'; else if txt = ' ' gnd1 + 0; gnd2 + 0; html = catt('title="' , upcase(city), ' (' , put(zip,z5.) , ')' , '0d'x , nSDI , txt , '0d'x , SDI1 , ' SDI' , '0d'x , SDI0 , ' DR "'); run; goptions reset=all ftext='calibri' htext=2 gunit=pct xpixels=1024 ypixels=768; pattern v=e; * choose legend attributes; /*legend1 mode=share shape=bar(3,4) label=(position=top 'Labs (Black=SDI, White=DR, Red:Both SDI and DR)') across=4 origin=(5,20);*/ title1 h=4 "Labs in the Continental US" ls=2; * whitespace; title2 a=90 ls=2; title3 a=-90 ls=2; footnote1 j=r "SDI=Green, DR=Blue, Both=Red" ls=1; proc gmap data=anno map=map all annotate=anno; id state; choro nfriends / statistic=sum levels=1 nolegend coutline=black ; run; quit;
... View more