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)
#> Error in md_compute_cumulative_share(welfare = md_GHI_2000_consumption$welfare,     weight = md_GHI_2000_consumption$weight): could not find function "md_compute_cumulative_share"