Compute the Gini coefficient for microdata.
Arguments
- welfare
numeric: A vector of income or consumption values
- weight
numeric: A vector of population weights, optional, a vector of 1s if not specified.
Details
Given a vector of income or consumption values and their respective weights
md_compute_gini()
computes the Gini coefficient for the distribution.
Examples
md_compute_gini(welfare = 1:2000, weight = rep(1, 2000))
#> [1] 0.3331667