06-16-2017 07:02 AM
I am actually trying to visualize my data using a map graph. Therefore, i decided to use proc gmap.
I have an excel file which contains different variables. One of them is the state id of polish voivodeships (in map Poland2 the variable is contained in the range between 1 to 16). For that reason I changed in the excel file the variable's name for wojid - so that it was the same in both input data set (the one from excel) and in the map dataset. I also changed the lenght of the variable (in the dataset imported from excel it was 8 and in the map it was 5) so using the data step i changed it in both for numeric 5. I sorted both map dataset by wojid and exported it by using 'out' statement and my excel dataset. I am not sure what steps should i take further. I have a variable dochg, which represents income. I would like to visualize the average income (var dochg) for every single voivedoship (var wojid) but unfortunately i am getting all the time an error. I am doing following procedures:
Sorting the dataset maps poland2 by var wojid and exporting it to dataset = polska.
proc sort data=maps.poland2 out=polska;
Changing the length of var wojid to 5.
length wojid 5.;
Sorting the new dataset by var wojid
proc sort data=gospy;
And then i would like to visualize the results by using below statement:
proc gmap data=gospy map=polska all;
And i get a following error :
34 proc gmap data=gospy map=polska;
35 id wojid;
36 choro dochg;
ERROR: Input data set missing X variable.
ERROR: Input data set missing Y variable.
I should add that i would like to firstly create a dataset which contains the average of the variable dochg classed by the variable wojid, therefore i use:
proc means data=idvar sum;
Can someone please help me? I am struggling with this case for quite a long time without any success. If you need any further info please let me know. I should add that i am quite new to data analysis and therefore I am not so fluent with cases in which i face problems. I am attaching the excel file with the dataset.
Thanks a lot in advance for any queries/answers!
06-16-2017 10:15 AM
The Poland2 data set is basically to provide name information. The actual map coordinate data set is Poland. There is a variable in the Poland data set ID that matches the Powiat value in the ID variable in the Poland2 set
06-20-2017 10:52 AM
Thank you very much,
can you as well tell me what can i do, if i want to use the proc means procedure in order to get the means of a variable dedicated to particular classes (options class in proc means) so that means were the only options in the dataset? Please see the pictures below. I use these codes:
proc means data=idvar mean;
proc print data=sredniak;
And I would like the dataset 'sredniak' to contain only the data which is shown using proc means. Unfortunately, if i use proc print then i get as well std, min, max and as well I get the general statistics for the whole dataset, not only for particular classes.