BookmarkSubscribeRSS Feed
lei
Obsidian | Level 7 lei
Obsidian | Level 7

Hi I have a project that aims to assess the percentage of screened patients within a county versus the average within the whole state. Due to overlap between the state average and county proportion, I have to test whether the county is different from the rest of the state. Therefore, I will have to calculate the proportion within the county and then calculate the proportion of screened within the state removing the county that I am comparing. For example, if state is made up of 20 counties. If I want to compare county 1 to the rest fo the state, I would have to calculate the state proportion without county 1. 

 

I am wondering if there's a way to do this in SAS easily? 

 

Thanks.

 

 

3 REPLIES 3
ballardw
Super User

Possibly easiest, as it doesn't require making lots of variables, would be to provide a custome format that assigns all of the county values except the one of interest to a "rest of state" vs the one you have. Use of the Keyword _other_ makes this relatively easy.

 

An example with numeric county codes:

proc format;

value Countygroup;

23="County Name"

_other_ = 'Rest of state'

;

run;

 

And assign that format to the county in your code.

If you have names or text categories then $countygroup for name and values like '23' or the county name on the left of =.

 

WARNING: if your county code is missing for any records they will be included in the "rest of state" group. If this isn't the desired behavior then you would need a separate format value or use a dataset option to drop those records.

lei
Obsidian | Level 7 lei
Obsidian | Level 7

Hi thank you so much. I have a quick question though. If I do this for all 20 counties, is this considered multiple comparison testing? For example, should I calculate the p-values and then use proc multtest to apply Bonferroni's correction? 

 

Thanks.

 

 

SteveDenham
Jade | Level 19

I think this is a clear case where an adjustment for multiple comparisons is needed, especially if you are going to examine differences between two states (say Texas and Wyoming, for example).  The number of counties is greatly different, and so to get comparisons on an equal basis, some sort of adjustment is needed.

 

I wouldn't go Bonferroni, though, as it is generally too conservative. Check out the alternatives in PROC MULTTEST for analysis of raw p values.

 

Steve Denham

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 2062 views
  • 0 likes
  • 3 in conversation