Calculate poverty headcount from microdata
pipmd_pov_headcount.Rd
Calculate poverty headcount from microdata
Arguments
- welfare
numeric: A vector of income or consumption values
- weight
numeric: A vector of population weights. If NULL, a vector of 1s is used to give equal weight to each observation.
- povline
numeric: Poverty line in international dollars, same units as welfare.
- times_mean
numeric factor that multiplies the mean to create a relative poverty line. Default is 1
- format
atomic character vector: specifies the format of output, either "dt", "list", or "atomic"
Value
A data.table
and data.frame
object of length equal to the povline
vector with variables povline
and pov_headcount
. See format
to change
the output format.
Examples
# Example 1: Basic poverty headcount calculation
pipmd_pov_headcount(welfare = pip_md_s$welfare,
weight = pip_md_s$weight,
povline = 1.3,
format = "list")
#> $pl1.3
#> $pl1.3$pov_headcount
#> [1] 0.208561
#>
#>
# Example 2: Returning data.table format, multiple povline.
pipmd_pov_headcount(welfare = pip_md_s$welfare,
weight = pip_md_s$weight,
povline = c(1.3, 1.2),
format = "dt")
#> povline pov_headcount
#> <num> <num>
#> 1: 1.3 0.2085610
#> 2: 1.2 0.1917473
# Example 3: Returning atomic format
pipmd_pov_headcount(welfare = pip_md_s$welfare,
weight = pip_md_s$weight,
povline = 1.3,
format = "atomic")
#> pl1.3
#> 0.208561