
Estimate the Gini coefficient, which is a measure for inequality, and its linearization.
lingini(
Y,
id = NULL,
weight = NULL,
sort = NULL,
Dom = NULL,
period = NULL,
dataset = NULL,
var_name = "lin_gini",
checking = TRUE
)
Study variable (for example equalized disposable income). One dimensional object convertible to one-column data.table
or variable name as character, column number.
Optional variable for unit ID codes. One dimensional object convertible to one-column data.table
or variable name as character, column number.
Optional weight variable. One dimensional object convertible to one-column data.table
or variable name as character, column number.
Optional variable to be used as tie-breaker for sorting. One dimensional object convertible to one-column data.table
or variable name as character, column number.
Optional variables used to define population domains. If supplied, linearization of the Gini is done for each domain. An object convertible to data.table
or variable names as character vector, column numbers.
Optional variable for survey period. If supplied, linearization of the Gini is done for each time period. Object convertible to data.table
or variable names as character, column numbers.
Optional survey data object convertible to data.table
.
A character specifying the name of the linearized variable.
Optional variable if this variable is TRUE, then function checks data preparation errors, otherwise not checked. This variable by default is TRUE.
return A list with two objects are returned by the function:
value
- a data.table
containing the estimated Gini coefficients (in percentage) by G. Osier and Eurostat.
lin
- a data.table
containing the linearized variables of the Gini coefficients (in percentage) by G. Osier.
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. Guillaume Osier (2009). Variance estimation for complex indicators of poverty and inequality. Journal of the European Survey Research Association, Vol.3, No.3, pp. 167-195, ISSN 1864-3361, URL https://ojs.ub.uni-konstanz.de/srm/article/view/369. Jean-Claude Deville (1999). Variance estimation for complex statistics and estimators: linearization and residual techniques. Survey Methodology, 25, 193-203, URL https://www150.statcan.gc.ca/n1/pub/12-001-x/1999002/article/4882-eng.pdf.
# NOT RUN {
library("laeken")
library("data.table")
data("eusilc")
dataset1 <- data.table(IDd = paste0("V", 1 : nrow(eusilc)), eusilc)[1 : 3,]
# Full population
dat1 <- lingini(Y = "eqIncome", id = "IDd",
weight = "rb050", dataset = dataset1)
dat1$value
# }
# NOT RUN {
# By domains
dat2 <- lingini(Y = "eqIncome", id = "IDd", weight = "rb050",
Dom = c("db040"), dataset = dataset1)
dat2$value
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab