Skip to contents

md_welfare_share_at returns the share of welfare held by an specified share of the population. You can select the number of quantiles (10 be default). This function makes use of md_compute_lorenz.

Usage

md_compute_cumulative_share(
  welfare = NULL,
  weight = rep(1, length = length(welfare)),
  n_quantile = 10,
  lorenz = NULL
)

Arguments

welfare

numeric: A vector of income or consumption values.

weight

numeric: A vector of weights. Default is a vector of ones

n_quantile

numeric: Number of quantiles for which share of total income is desired. Default is 10.

lorenz

numeric: Output from md_compute_lorenz

Value

list with vector of share of welfare by quantiles

Examples

md_compute_cumulative_share(welfare = md_GHI_2000_consumption$welfare,
                            weight = md_GHI_2000_consumption$weight)
#>  [1] 0.03092151 0.07567582 0.13050074 0.19541293 0.27138699 0.35893258
#>  [7] 0.46149515 0.58353619 0.73668432 1.00000000