View source: R/md_compute_lorenz.R
md_compute_lorenz | R Documentation |
Compute the Lorenz curve for microdata.
md_compute_lorenz(
welfare,
weight = rep(1, length(welfare)),
nbins = if (length(welfare) > 1000) 100 else 20,
force_nbins = TRUE
)
welfare |
numeric: A vector of income or consumption values. |
weight |
numeric: A vector of weights. Default is a vector of ones,
|
nbins |
numeric: number of points on the Lorenz curve. if |
force_nbins |
logical; Force the creation of exact nbins even there is no actual data that falls in the corresponding interval. This implies that some observations will be repeated. |
Given a vector of weights and welfare, this functions computes the Lorenz curve.
data.frame
md_compute_lorenz(welfare = md_ABC_2010_income$welfare,
weight = md_ABC_2010_income$weight)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.