powered by
weighted.median(x, w, na.rm = FALSE)
x
NA
w
Missing values in w are not handled.
The weighted median is the median of the discrete distribution with values given by x and probabilities given by w/sum(w).
w/sum(w)
median
weighted.mean
## GPA from Siegel 1994 wt <- c(5, 5, 4, 1)/15 x <- c(3.7,3.3,3.5,2.8) xm <- weighted.median(x,wt)
Run the code above in your browser using DataLab