powered by
Computes the weighted quantiles of a distribution.
weighted.quantile(x, weights = NULL, probs = seq(0, 1, 0.25), na.rm = FALSE, names = FALSE)
A numeric vector of the same length as probs argument.
probs
numeric vector whose sample quantiles are wanted
numeric vector of weights. If NULL (default), uniform weights (i.e. all equal to 1) are used.
numeric vector of probabilities with values in [0,1]
logical, indicating whether NA values should be silently removed before the computation proceeds. Default is FALSE.
logical. if TRUE, the result has a names attribute. Default is FALSE.
weighted.mad
data(Movies) weighted.quantile(Movies$Critics, weights = rep(c(.8,1.2), 500), names = TRUE)
Run the code above in your browser using DataLab