gpg: Gender pay (wage) gap.

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

View source: R/gpg.R

Description

Estimate the gender pay (wage) gap.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
gpg(
  inc,
  gender = NULL,
  method = c("mean", "median"),
  weights = NULL,
  sort = NULL,
  years = NULL,
  breakdown = NULL,
  design = NULL,
  cluster = NULL,
  data = NULL,
  var = NULL,
  alpha = 0.05,
  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.

gender

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

method

a character string specifying the method to be used. Possible values are "mean" for the mean, and "median" for the median. If weights are provided, the weighted mean or weighted median is estimated.

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.

breakdown

optional; either a numeric vector giving different domains, or (if data is not NULL) a character string, an integer or a logical vector specifying the corresponding column of data. If supplied, the values for each domain are computed in addition to the overall value.

design

optional and only used if var is not NULL; either an integer vector or factor giving different strata for stratified sampling designs, or (if data is not NULL) a character string, an integer or a logical vector specifying the corresponding column of data.

cluster

optional and only used if var is not NULL; either an integer vector or factor giving different clusters for cluster sampling designs, or (if data is not NULL) a character string, an integer or a logical vector specifying the corresponding column of data.

data

an optional data.frame.

var

a character string specifying the type of variance estimation to be used, or NULL to omit variance estimation. See variance for possible values.

alpha

numeric; if var is not NULL, this gives the significance level to be used for computing the confidence interval (i.e., the confidence level is 1 - alpha).

na.rm

a logical indicating whether missing values should be removed.

...

if var is not NULL, additional arguments to be passed to variance.

Details

The implementation strictly follows the Eurostat definition (with default method "mean" and alternative method "median"). If weights are provided, the weighted mean or weighted median is estimated.

Value

A list of class "gpg" (which inherits from the class "indicator") with the following components:

value

a numeric vector containing the overall value(s).

valueByStratum

a data.frame containing the values by domain, or NULL.

varMethod

a character string specifying the type of variance estimation used, or NULL if variance estimation was omitted.

var

a numeric vector containing the variance estimate(s), or NULL.

varByStratum

a data.frame containing the variance estimates by domain, or NULL.

ci

a numeric vector or matrix containing the lower and upper endpoints of the confidence interval(s), or NULL.

ciByStratum

a data.frame containing the lower and upper endpoints of the confidence intervals by domain, or NULL.

alpha

a numeric value giving the significance level used for computing the confidence interv al(s) (i.e., the confidence level is 1 - alpha), or NULL.

years

a numeric vector containing the different years of the survey.

strata

a character vector containing the different domains of the breakdown.

Author(s)

Matthias Templ and Alexander Haider, using code for breaking down estimation by 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

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, Luxembourg.

See Also

variance, qsr, gini

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(ses)

# overall value with mean
gpg("earningsHour", gender = "sex", weigths = "weights",
    data = ses)

# overall value with median
gpg("earningsHour", gender = "sex", weigths = "weights",
    data = ses, method = "median")

# values by education with mean
gpg("earningsHour", gender = "sex", weigths = "weights",
    breakdown = "education", data = ses)

# values by education with median
gpg("earningsHour", gender = "sex", weigths = "weights",
    breakdown = "education", data = ses, method = "median")

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