compute_gini | R Documentation |
Compute a weighted Gini coefficient by integrating the generalized Lorenz curve.
compute_gini(dep_var, weights)
dep_var |
values of a non-negative continuous variable |
weights |
numeric vector of non-negative observation weights, hence of same length as |
The numeric value indicating the weighted Gini coefficient of the the dependent variable.
Firpo, Sergio P., Nicole M. Fortin, and Thomas Lemieux. 2018. “Decomposing Wage Distributions Using Recentered Influence Function Regressions.” Econometrics 6(2), 28.
set.seed(123)
dep_var <- rlnorm(100)
weights <- rep(1, 100)
compute_gini(dep_var, weights)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.