11-29-2013 04:27 PM
This may be simplest to learn extreme values of your data.
title 'Extreme Blood Pressure Observations';
ods select ExtremeObs;
proc univariate data=BPressure;
var Systolic Diastolic;
11-29-2013 06:00 PM
There are an infinite number of methods you could use. Another simple method might be to classify any observation as an outlier if it falls above or below the outer fences of a boxplot:
Lower outer fence: Q1 - 3*IQ
Upper outer fence: Q3 + 3*IQ
Where IQ is the interquartile range, Q1 is the first quartile, and Q3 is the third quartile.
12-02-2013 01:59 PM
Thanks for your reply.
What would be code for displaying only values above or below the outer fences of a boxplot.
I have tried to create the program but unsuccessfully.
12-02-2013 02:18 PM
You could try something like this. I'm sure there's more elegant code, but this is what I whipped up in a minute. All you'd need to do is replace the values of dsn with your dataset name and VariableOfInterest with the variable name in the dsn dataset that you want to examine for outliers.
proc univariate data=work.temp noprint;
output out=work.IQRData Q1=Q1 Q3=Q3 QRANGE=IQR;
proc sql noprint;
select Q1-3*IQR, Q3+3*IQR into :lowerfence, :upperfence
%put Outliers are those observations less than &lowerfence and greater than &upperfence;
if &VariableOfInterest gt &upperfence or height lt &lowerfence then output;