BookmarkSubscribeRSS Feed
bibbnd
Fluorite | Level 6

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

1 REPLY 1
ballardw
Super User

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?

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 304 views
  • 0 likes
  • 2 in conversation