You can use PROC QUANTREG. Suppose you have two variables, y1 and y2, that potentially have different medians. Create a new variable y that is just y1 stacked on top of y2, and create a dummy variable x that has a value of 0 if an observation is from y1 and a value of 1 if an observation is from y2. Now you can use QUANTREG to estimate the median conditional on the value of x. The TEST statement performs a WALD test of whether the effect of x is significantly different from 0. Here is a sample program that demonstrates: data one; call streaminit(736283); do i = 1 to 100; if i<51 then y=rand('NORMAL',0,1); if i<51 then x=0; if i>=51 then y=rand('NORMAL',1,1); if i>=51 then x=1; output; end; run; proc quantreg data=one; class x; model y=x; test x; run; The resulting Wald test statistic is 13.2403, the p-value is 0.0003.
... View more