incMedian: Weighted median income

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

View source: R/incMedian.R

Description

Compute the weighted median income.

Usage

1
2
3
4
5
6
7
8
incMedian(
  inc,
  weights = NULL,
  sort = NULL,
  years = NULL,
  data = NULL,
  na.rm = FALSE
)

Arguments

inc

either a numeric vector giving the (equivalized disposable) income, or (if data is not NULL) a character string, an integer or a logical vector specifying the corresponding column of data.

weights

optional; either a numeric vector giving the personal sample weights, or (if data is not NULL) a character string, an integer or a logical vector specifying the corresponding column of data.

sort

optional; either a numeric vector giving the personal IDs to be used as tie-breakers for sorting, or (if data is not NULL) a character string, an integer or a logical vector specifying the corresponding column of data.

years

optional; either a numeric vector giving the different years of the survey, or (if data is not NULL) a character string, an integer or a logical vector specifying the corresponding column of data. If supplied, values are computed for each year.

data

an optional data.frame.

na.rm

a logical indicating whether missing values should be removed.

Details

The implementation strictly follows the Eurostat definition.

Value

A numeric vector containing the value(s) of the weighted median income is returned.

Author(s)

Andreas Alfons

References

Working group on Statistics on Income and Living Conditions (2004) Common cross-sectional EU indicators based on EU-SILC; the gender pay gap. EU-SILC 131-rev/04, Eurostat.

See Also

arpt, weightedMedian

Examples

1
2
data(eusilc)
incMedian("eqIncome", weights = "rb050", data = eusilc)

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