md_compute_gini: Gini coefficient

View source: R/md_compute_gini.R

md_compute_giniR Documentation

Gini coefficient

Description

Compute the Gini coefficient for microdata.

Usage

md_compute_gini(welfare, weight)

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.

Value

numeric

Examples

md_compute_gini(welfare = 1:2000, weight = rep(1, 2000))

PIP-Technical-Team/wbpip documentation built on Nov. 29, 2024, 6:57 a.m.