BookmarkSubscribeRSS Feed
tarkom
Obsidian | Level 7

@GraphGuyThank very much. This is very helpful

The only issue is that the map=maps.us is broken and so mapsgfk.us_states is used in place of maps.us.

 

I appreciate all your inputs.

 

Regards,

GraphGuy
Meteorite | Level 14

Per your "broken" maps.us ... perhaps you have somehow corrupted it (if you have write permission to it).

If that is the case, you should be able to download a fresh copy of the dataset from the SAS mapsonline website:

I think it would be the 5th one labeled "United States" in this table:

 

   http://support.sas.com/rnd/datavisualization/mapsonline/html/v92maps.html

 

tarkom
Obsidian | Level 7

Oh great. Thank you. Really helpful

tarkom
Obsidian | Level 7

@GraphGuy @ballardw @Reeza what I will like to know is that will levels = 3 means I will be dealing with 3 quartiles, i.e, 1st quartile, median and 3rd quartile? 

 

thank you all

GraphGuy
Meteorite | Level 14

As I understand it, with quantile binning, when you specify levels=3, each of the legend bins will have approximately 1/3 of the states in it.

 

Here's a more detailed description in the SAS doc:

 

http://go.documentation.sas.com/?docsetId=grmapref&docsetTarget=n0b7n2mnw4t6lhn0zoy86orv95z2.htm&doc...

 

tarkom
Obsidian | Level 7

@GraphGuyThank you very much. Sounds good to me. Will read through the link as well.

Reeza
Super User

@tarkom wrote:

@GraphGuy @ballardw @Reeza what I will like to know is that will levels = 3 means I will be dealing with 3 quartiles, i.e, 1st quartile, median and 3rd quartile? 

 

thank you all


3 cannot be quartiles, quartiles by definition are quarters, ie 25%, 50%, 75% etc.

 

Group=3 would be Tertiles, 1/3, 2/3, 3/3 instead. 

 

 

tarkom
Obsidian | Level 7

you are right @Reeza. But I asked that because if we specify levels = 4, it gives 4 different categories which doesn't seem to be the 25%, 50%  and 75% quartile ranges. So I was wondering why levels = 4 will represent the quartiles but has 4 categories on the map.

 

Regards,

GraphGuy
Meteorite | Level 14

Hmm ... my code might have been too simple...

 

In looking at this closer, I notice there are multiple data obsns per each state, and by default (if you don't specify a statistic), gmap just uses the first obsn for each state, and writes the following message to the log:

 

  "WARNING: Some observations were discarded when charting No_Exercise. Only first matching observation was used. Use STATISTIC= option for summary statistics."

 

I'll have to look at this again tomorrow. My initial thought is to specify 'statistic=mean' - I think this would get the mean value for each state, and then do the quantile binning on that.

 

 

tarkom
Obsidian | Level 7

@GraphGuyThat's right.

 

Thank you

Reeza
Super User

@tarkom this means you should presummarize your data, using PROC MEANS and then PROC RANK.

tarkom
Obsidian | Level 7

@ReezaI will want to know if that will be different than the proc means that I used in calculating the quartiles? or I have to do this differently?

Reeza
Super User

If you didn't sum before you did the quartiles then it very likely would be. That's a matter of SME at that point to me, whether you should first aggregate or do quartiles. The quartiles should match the groups from PROC RANK - unless you have a lot of ties and haven't specified how those should be accounted for. But there's no need to guess here either, it's relatively trivial exercise to test it with the two methods and then use PROC COMPARE to compare the final results. 

tarkom
Obsidian | Level 7

Interesting...I am probably suffering with this because I am very new to SAS and so I don't have a full grasp of the ins and outs of SAS. So I thought after computing for the quartiles, (Q1, Median and Q3), I could simply map that on a US States map to show how the 10 variables will be spread in terms of their quartiles on the map. But it doesn't seem simple.

 

I am still thinking through it...

 

Thanks very much @Reeza

Reeza
Super User

That is correct, but are you calculating the quartiles based on the raw data or do you first need to summarize your data to a common aggregation? So, if you were using STATES as your level, you currently have data at a county level or possibly lower, I didn't investigate too much. 

 

And you used PROC MEANS which calculated the percentiles values rather than grouped them into the 4 quartiles, that would be done with PROC RANK or you pre-processing the data after PROC MEANS.

 

I think you should get your methodology sorted out first, how you want to do it and then we can provide more directions. 

 

 

I have a personal rule, where I only make suggestions for homework, because the purpose is for you to learn how to do it, not learn how to get others to do your work. This appears like homework so I won't provide code. Others will so you can always wait for a different response. 

 

 

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 46 replies
  • 3615 views
  • 3 likes
  • 4 in conversation