reweightOut: Reweight outliers in the Pareto model

View source: R/paretoTail.R

reweightOutR Documentation

Reweight outliers in the Pareto model

Description

Reweight observations that are flagged as outliers in a Pareto model for the upper tail of the distribution.

Usage

reweightOut(x, ...)

## S3 method for class 'paretoTail'
reweightOut(x, X, w = NULL, ...)

Arguments

x

an object of class "paretoTail" (see paretoTail).

...

additional arguments to be passed down.

X

a matrix of binary calibration variables (see calibVars). This is only used if x contains sample weights or if w is supplied.

w

a numeric vector of sample weights. This is only used if x does not contain sample weights, i.e., if sample weights were not considered in estimating the shape parameter of the Pareto distribution.

Details

If the data contain sample weights, the weights of the outlying observations are set to 1 and the weights of the remaining observations are calibrated according to auxiliary variables. Otherwise, weight 0 is assigned to outliers and weight 1 to other observations.

Value

If the data contain sample weights, a numeric containing the recalibrated weights is returned, otherwise a numeric vector assigning weight 0 to outliers and weight 1 to other observations.

Author(s)

Andreas Alfons

References

A. Alfons and M. Templ (2013) Estimation of Social Exclusion Indicators from Complex Surveys: The R Package laeken. Journal of Statistical Software, 54(15), 1–25. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v054.i15")}

A. Alfons, M. Templ, P. Filzmoser (2013) Robust estimation of economic indicators from survey samples based on Pareto tail modeling. Journal of the Royal Statistical Society, Series C, 62(2), 271–286.

See Also

paretoTail, shrinkOut , replaceOut, replaceTail

Examples

data(eusilc)

## gini coefficient without Pareto tail modeling
gini("eqIncome", weights = "rb050", data = eusilc)

## gini coefficient with Pareto tail modeling
# estimate threshold
ts <- paretoScale(eusilc$eqIncome, w = eusilc$db090,
    groups = eusilc$db030)
# estimate shape parameter
fit <- paretoTail(eusilc$eqIncome, k = ts$k,
    w = eusilc$db090, groups = eusilc$db030)
# calibration of outliers
w <- reweightOut(fit, calibVars(eusilc$db040))
gini(eusilc$eqIncome, w)


laeken documentation built on May 29, 2024, 4:42 a.m.