Learn R Programming

laeken (version 0.3.2)

gini: Gini coefficient

Description

Estimate the Gini coefficient, which is a measure for inequality.

Usage

gini(inc, weights = NULL, sort = NULL, years = NULL, 
     breakdown = NULL, design = 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.
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 <
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
breakdown
optional; either a numeric vector giving different strata, or (if data is not NULL) a character string, an integer or a logical vector specifying the corresponding column of data. If supplied, the val
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 integ
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.

Value

  • A list of class "gini" (which inherits from the class "indicator") with the following components:
  • valuea numeric vector containing the overall value(s).
  • valueByStratuma data.frame containing the values by stratum, or NULL.
  • varMethoda character string specifying the type of variance estimation used, or NULL if variance estimation was omitted.
  • vara numeric vector containing the variance estimate(s), or NULL.
  • varByStratuma data.frame containing the variance estimates by stratum, or NULL.
  • cia numeric vector or matrix containing the lower and upper endpoints of the confidence interval(s), or NULL.
  • ciByStratuma data.frame containing the lower and upper endpoints of the confidence intervals by stratum, or NULL.
  • alphaa numeric value giving the significance level used for computing the confidence interval(s) (i.e., the confidence level is $1 -$alpha), or NULL.
  • yearsa numeric vector containing the different years of the survey.
  • strataa character vector containing the different strata of the breakdown.

Details

The implementation strictly follows the Eurostat definition.

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

variance, qsr

Examples

Run this code
data(eusilc)

# overall value
gini("eqIncome", weights = "rb050", data = eusilc)

# values by region
gini("eqIncome", weights = "rb050", 
    breakdown = "db040", data = eusilc)

Run the code above in your browser using DataLab