An Idea Exchange for SAS software and services

Comments
by SAS Employee JasonXin
on ‎09-28-2013 08:56 PM

I am not sure what you mean by "the median excludes the obs itself". You mean you just want the median to show up in the final report/data set, but not the original observations?

Let me try to translate your question. Hopefully get to closer a bit. You probably just want to run median values, by two values, one is industry X and the other Decile. So it would be calculating median via BY group processing? Just a guess.

Jason Xin

by Trusted Advisor
on ‎10-15-2013 11:12 AM

You're requesting what I would term a "complimentary median" - i.e. for each observation you want the median of all the rest of the observations - sort of an observational influence measure on the median statistic.  I don't think we have any such influence measures (on median or other stats) in any of the univariate distribution proc's (not in proc means or proc univariate anyhow).  What influence measures SAS does have are in some of the modelling proc's, and I suspect they are not oriented to measures related to non-parametric stats.

Also, it's not a difficult problem to solve as is, because effectively all you really want is 3 medians.  If the observation is one of the (usually) 50% greater than the grand median you'll always get the same value for the complementary median, call it M+.  If it 's one of the 50% below the grand median, you'll get a second value (M-).  If it is exactly the grand median, you'll either still get the grand median or M+ or M-, depending on the number of observations that exactly equal the grand median.  With only 3 unique values coming out, I wouldn't even think of it as a useful influence measure.  It's just a technique to avoid double counting an observation when you consider its value against the median of the other obs - important only with small samples.

Idea Statuses
Top Liked Authors