md_compute_dist_stats: Compute distributional statistics

View source: R/md_compute_dist_stats.R

md_compute_dist_statsR Documentation

Compute distributional statistics

Description

Given a vector of weights and welfare, this functions computes the various distributional statistics.

Usage

md_compute_dist_stats(
  welfare,
  weight,
  mean = NULL,
  nbins = 10,
  lorenz = NULL,
  n_quantile = 10
)

Arguments

welfare

numeric: A vector of income or consumption values

mean

numeric: A value with the mean. Optional.

nbins

numeric: number of points on the Lorenz curve. Optional. Only used if lorenz is NULL. Default is 10.

lorenz

data.frame: A table with points on the Lorenz curve. Output of md_compute_lorenz(). Optional.

n_quantile

numeric: Number of quantiles for which share of total income is desired. It can't be larger that the total number of percentiles in the Lorenz curve provided by the user. Default is 10.

Value

data.frame

Examples

wbpip:::md_compute_dist_stats(welfare = 1:2000, weight = rep(1, 2000))

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