Skip to contents

Compute median for microdata

Usage

md_compute_median(welfare, weight = rep(1, length(welfare)), lorenz = NULL)

Arguments

welfare

numeric: A vector of income or consumption values.

weight

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

lorenz

numeric: Output from md_compute_lorenz

Value

numeric

Examples

md_compute_median(welfare = 1:2000, weight = rep(1, 2000))
#> [1] 1000