I am trying to sort my data from a dataset in order to make a gmap and was asked the following:
This is my code:
proc sort data = saslab3;
by sex= 'female' cause= 'storke';
run;
proc gmap map = usstates
data = saslab3
all;
id sex ='female' cause= 'stroke';
choro ER_Visit_rate / levels = 3 missing;
run;
quit;
This is the error I am receiving when I run proc sort:
This is my legend:
When I run the GMAP code I get the following error:
I was told USstates exists in sas?
From now on, please include logs as plain text (not screen captures) by clicking on the </> icon and then pasting your log into the window that appears.
You cannot do subsetting in a BY statement or an ID statement. You do subsetting in a WHERE statement, you can do this in PROC GMAP, and then PROC SORT isn't needed. Give it a try.
@saza wrote:
When I run the GMAP code I get the following error:
I was told USstates exists in sas?
If you look in your WORK library, you do not see USSTATES, so you have the wrong library. If you look in the MAPSGFK library, you find a data set that is spelled US_STATES, perhaps that is the one you want.
Yes, US_STATES is a map data set, it contains the co-ordinates of the boundaries of the different states so that a map can be drawn. It doesn't contain SEX.
You provide a "legend" showing a variable named SEX, what data set is that?
Also, no need for PROC SORT.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.