I have 12 different groups and i need to apply the LB and UB IQR to each one individually.
I used proc univariate to get the stats and than calculated each IQR. I am trying to figure out how to apply the correct IQR to the datasets to flag the outliers .
here is some of my code. I haven't started coding the next step because i really have no idea. I was thinking do loops and macros.
proc means data=test5 mean median mode p25 p75 p99 max n skewness qrange;
var rate_amt;
output out=prox_rate(drop=_type_) mean=mean median=median mode=mode min=min p25=p25 p75=p75 max=max qrange=IQR;
by zone nems lowincome rate;
run;
data prox_rate2;
set prox_rate;
lb=p25-1.5*IQR;
UB=P75+1.5+IQR;
RUN;
I HAVE ATTACHED A SAMPLE DATA SET
Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.
Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the <> icon or attached as text to show exactly what you have and that we can test code against.
Apply bounds to what? Where?
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 25. Read more here about why you should contribute and what is in it for you!
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.