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