I am computing the weighted median for a dataset using the R reldist package.

The input data are integers but my result is an integer number too.

Should't my result be a decimal number?


1 Answer 1


No. The standard median is the value such that if you sort a list of values, it is the middle one. If the list has an even number of values, it is the average of the two middle values. In weighted median would have a list of tuples of the values and non-negative weights $(x_i, w_i)$, you sort it by the $x_i$ values and the median is the value at index $k$ such that the sum of weights on both sides is roughly the same, see the Wikipedia link for details.

So if your data is integers, the median would be an integer, because it is an actual value observed in your data, unless it is interpolated as in standard median.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.