quantileWt {simPop}R Documentation

Weighted sample quantiles

Description

Compute quantiles taking into account sample weights. The following methods are implemented:

Additional parameters are:

Usage

quantileWt(x, ...)

Arguments

x

a numeric vector.

...

for the generic function quantileWt additional arguments to be passed to methods. Additional arguments not included in the definition of the methods are currently ignored.

Details

If weights are not specified then quantile(x, probs, na.rm=na.rm, names=FALSE, type=1) is used for the computation.

Note probabilities outside [0, 1] cause an error.

Value

A vector of the (weighted) sample quantiles.

Author(s)

Stefan Kraft and Bernhard Meindl

A basic version of this function was provided by Cedric Beguin and Beat Hulliger.

See Also

quantile

Examples


data(eusilcS)
(quantileWt(eusilcS$netIncome, weights=eusilcS$rb050))

# dataObj-method
inp <- specifyInput(data=eusilcS, hhid="db030", hhsize="hsize", strata="db040", weight="db090")
(quantileWt(inp, vars="netIncome"))


[Package simPop version 2.1.3 Index]