Weighted mean sum(x w) / sum(w). Equivalent to R's weighted.mean(). Values with weight 0 do not enter the numerator (even if infinite or NaN), and naRm drops missing values of x with their weights.
sum(x w) / sum(w)
weighted.mean()
naRm
x
weightedMean([1, 2, 3], [3, 1, 1]); // 1.6 Copy
weightedMean([1, 2, 3], [3, 1, 1]); // 1.6
Weighted mean
sum(x w) / sum(w). Equivalent to R'sweighted.mean(). Values with weight 0 do not enter the numerator (even if infinite or NaN), andnaRmdrops missing values ofxwith their weights.