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.
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.
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.
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: