Weighted Medians with Proc Univariate

Weighted Medians with Proc Univariate

Weighted Medians with Proc Univariate

Contributed by Catherine Montalto and Hui Wang

As noted previously, in SAS, use of the weight command by itself will
weight the mean in a PROC UNIVARIATE but not the median and other
quantiles.

We have discovered that you can get correct quantile information on weighted
data with the PROC UNIVARIATE command by using the option FREQ {weight
variable}.

The advantage to this approach is more efficient print outs than the PROC
FREQ with WEIGHT, because PROC UNIVARIATE produces a single page of output.

The disadvantage is that the PROC UNIVARIATE with FREQ {weight} recognizes
only the integer portion of the weight variable.

The results may be close to use of a weighted PROC FREQ.


Return to SCF Data Section Home Page

Return to SCF Research Group Home Page