I'm try to compute the difference between each observation's value of a certain variable (A) and the median of the same variable (A) for
its joint industry (X) and performance (Y) decile, where the median excludes the obs itself. I already created deciles for variable Y within each industry X,
but can't figure out how to calculate the median of each decile excluding the obs. Any suggestions are much appreciated!
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.