compute_gini {rifreg}R Documentation

Compute Gini coefficient

Description

Compute a weighted Gini coefficient by integrating the generalized Lorenz curve.

Usage

compute_gini(dep_var, weights)

Arguments

dep_var

values of a non-negative continuous variable

weights

numeric vector of non-negative observation weights, hence of same length as dep_var.

Value

The numeric value indicating the weighted Gini coefficient of the the dependent variable.

References

Firpo, Sergio P., Nicole M. Fortin, and Thomas Lemieux. 2018. “Decomposing Wage Distributions Using Recentered Influence Function Regressions.” Econometrics 6(2), 28.

Examples


set.seed(123)
dep_var <- rlnorm(100)
weights <- rep(1, 100)
compute_gini(dep_var, weights)


[Package rifreg version 0.1.0 Index]