Problem Note 14737: PROC MEANS/SUMMARY incorrectly assigning missing value to weighted
PROC MEANS/SUMMARY may incorrectly assign a missing value to a weighted
statistic. The problem occurs when there are multiple VAR statements,
each with a different WEIGHT variable specified and one or more of the
WEIGHT variable values is missing on a previous VAR statement.
In the example below, Z will have a missing weighted mean for some
observations even though W1 has no missing values. W2 does
have missing values, and they are incorrectly affecting the statistics
input x y z w1 w2;
2 3 4 1 1
2 3 4 1 .
proc means data=test;
var x / weight=w1;
var y / weight=w2;
var z / weight=w1;