[4][5] Like the median, it is useful as an estimator of central tendency, robust against outliers.
It allows for non-uniform statistical weights related to, e.g., varying precision measurements in the sample.
This occurs when both element's respective weights border the midpoint of the set of weights without encapsulating it; Rather, each element defines a partition equal to
These elements are referred to as the lower weighted median and upper weighted median.
Their conditions are satisfied as follows: Lower Weighted Median Upper Weighted Median Ideally, a new element would be created using the mean of the upper and lower weighted medians and assigned a weight of zero.
This method is similar to finding the median of an even set.
The new element would be a true median since the sum of the weights to either side of this partition point would be equal.
Depending on the application, it may not be possible or wise to create new data.
In this case, the weighted median should be chosen based on which element keeps the partitions most equal.
In the event that the upper and lower weighted medians are equal, the lower weighted median is generally accepted as originally proposed by Edgeworth.
[6] The sum of weights in each of the two partitions should be as equal as possible.
If the weights of all numbers in the set are equal, then the weighted median reduces down to the median.
Any other weight would result in a greater difference between each side of the pivot.
The lower weighted median is 2 with partition sums of 0.25 and 0.5, and the upper weighted median is 3 with partition sums of 0.5 and 0.25.
It is ideal to introduce a new pivot by taking the mean of the upper and lower weighted medians when they exist.
It can easily be seen that the weighted median and median are the same for any size set with equal weights.
The lower weighted median is 2 with partition sums of 0.49 and 0.5, and the upper weighted median is 3 with partition sums of 0.5 and 0.25.
In the case of working with integers or non-interval measures, the lower weighted median would be accepted since it is the lower weight of the pair and therefore keeps the partitions most equal.
However, it is more ideal to take the mean of these weighted medians when it makes sense instead.
Coincidentally, both the weighted median and median are equal to 2.5, but this will not always hold true for larger sets depending on the weight distribution.
The weighted median can be computed by sorting the set of numbers and finding the smallest set of numbers which sum to half the weight of the total weight.
There is a better approach to find the weighted median using a modified selection algorithm.