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