[R] Quantiles of weighted sample

Thomas Lumley tlumley at u.washington.edu
Wed Oct 8 21:43:03 CEST 2008


On Wed, 8 Oct 2008, Giovanni Petris wrote:
> I am wondering if there is a function in R that returns quantiles of a
> weighted sample, i.e., a set of values, each coming with a different
> weight. The function quantile() does that only for the case when the
> weights are all equal.
>
> In other words, I am looking for a quantile function that applies to
> a discrete distribution specified by values and their probabilities.
>

There are at least two weighted quantile functions in packages: 
Hmisc::weighted.quantile and survey::svyquantile

 	-thomas



More information about the R-help mailing list