BookmarkSubscribeRSS Feed
thb
Fluorite | Level 6 thb
Fluorite | Level 6

Hello,

 

I am trying to identifyi outliers within my dataset with multiple by variables.  Please see an example of the data below:

IDMeasureDateNumeratorDenominator
1A1-Jan10
1A2-Jan501
1A3-Jan280
1B1-Jan11
1B2-Jan5050
1B3-Jan22
2A1-Jan11
2A2-Jan22
2B1-Jan11
2B2-Jan20
3A1-Jan11
3A2-Jan20
3B1-Jan12
3B2-Jan503
3C1-Jan21
3C2-Jan21

 

 

I'm trying to identify the outliers with the Numerators and Denominators by ID and Measure.  So far, I have the following code, but it's not producing the desired results. 

 

 

Also, is there a way to create a separate table with the 'n median qrange p25 p75' by ID and Measure?

 

Any assistance would be greatly appreciated. Thank you!

 

 

proc MEANS Data=have
n median qrange p25 p75;
var Numerator;
class ID Measure;
ods output summary=ranges;
run;




data Out;
  set have;
  Outlier = IFC(Numerator > (Numerator*3), 'Y','N');
run;
  

 

1 REPLY 1
PaigeMiller
Diamond | Level 26
proc summary data=have;
    class id measure;
    var numerator denominator;
    output out=stats n= median= p25= p75=/autoname;
run;
data want;
    if _n_=1 then set stats;
    set have;
run;
--
Paige Miller

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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