Calculate poverty severity from microdata
pipmd_pov_severity.Rd
Calculate poverty severity 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_severity
.
See format
to change the output format.
Examples
# Example 1: Basic poverty headcount calculation
pipmd_pov_severity(welfare = pip_md_s$welfare,
weight = pip_md_s$weight,
povline = 1.3,
format = "list")
#> $pl1.3
#> $pl1.3$pov_severity
#> [1] 0.02972097
#>
#>
# Example 2: Returning data.table format and multiple povline
pipmd_pov_severity(welfare = pip_md_s$welfare,
weight = pip_md_s$weight,
povline = c(1.3, 1.2),
format = "dt")
#> povline pov_severity
#> <num> <num>
#> 1: 1.3 0.02972097
#> 2: 1.2 0.02413119
# Example 3: Returning atomic format
pipmd_pov_severity(welfare = pip_md_s$welfare,
weight = pip_md_s$weight,
povline = 1.3,
format = "atomic")
#> pl1.3
#> 0.02972097