*** Welcome to piglix ***

Weighted average


The weighted arithmetic mean is similar to an ordinary arithmetic mean (the most common type of average), except that instead of each of the data points contributing equally to the final average, some data points contribute more than others. The notion of weighted mean plays a role in descriptive statistics and also occurs in a more general form in several other areas of mathematics.

If all the weights are equal, then the weighted mean is the same as the arithmetic mean. While weighted means generally behave in a similar fashion to arithmetic means, they do have a few counterintuitive properties, as captured for instance in Simpson's paradox.

Given two school classes, one with 20 students, and one with 30 students, the grades in each class on a test were:

The straight average for the morning class is 80 and the straight average of the afternoon class is 90. The straight average of 80 and 90 is 85, the mean of the two class means. However, this does not account for the difference in number of students in each class (20 versus 30); hence the value of 85 does not reflect the average student grade (independent of class). The average student grade can be obtained by averaging all the grades, without regard to classes (add all the grades up and divide by the total number of students):

Or, this can be accomplished by weighting the class means by the number of students in each class (using a weighted mean of the class means):

Thus, the weighted mean makes it possible to find the average student grade in the case where only the class means and the number of students in each class are available.

Since only the relative weights are relevant, any weighted mean can be expressed using coefficients that sum to one. Such a linear combination is called a convex combination.

Using the previous example, we would get the following weights:



Then, apply the weights like this:

Formally, the weighted mean of a non-empty set of data

(where x represents a set of mean values) with non-negative weights

which means:

Therefore data elements with a high weight contribute more to the weighted mean than do elements with a low weight. The weights cannot be negative. Some may be zero, but not all of them (since division by zero is not allowed).


...
Wikipedia

...