replaceTail: Replace observations under a Pareto model

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/paretoTail.R

Description

Replace observations under a Pareto model for the upper tail with values drawn from the fitted distribution.

Usage

1
2
3
4
5
6
replaceTail(x, ...)

## S3 method for class 'paretoTail'
replaceTail(x, all = TRUE, ...)

replaceOut(x, ...)

Arguments

x

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

...

additional arguments to be passed down.

all

a logical indicating whether all observations in the upper tail should be replaced or only those flagged as outliers.

Details

replaceOut(x, ...{}) is a simple wrapper for replaceTail(x, all = FALSE, ...{}).

Value

A numeric vector consisting mostly of the original values, but with observations in the upper tail replaced with values from the fitted Pareto distribution.

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. 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, reweightOut, shrinkOut

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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)

# replacement of outliers
eqIncome <- replaceOut(fit)
gini(eqIncome, weights = eusilc$rb050)

# replacement of whole tail
eqIncome <- replaceTail(fit)
gini(eqIncome, weights = eusilc$rb050)

laeken documentation built on Oct. 6, 2021, 5:07 p.m.