This function checks if an individual's income category corresponds to the lowest income quintile.
Arguments
- incq
integer A categorical vector indicating the income category as defined by the categorize_income function.
Value
integer Whether the individual is in the lowest income quintile:
1: In the lowest income quntile
2: Not in the lowest income quntile
haven::tagged_na("a"): Not applicablehaven::tagged_na("b"): Missing
Details
This function identifies individuals in the lowest income quintile, a common indicator for socioeconomic disadvantage.
Examples
# Scalar usage: Single respondent
# Example 1: Check if an income category of 3 is in the lowest quintile
in_lowest_income_quintile(3)
#> [1] 2
# Output: 2
# Example 2: Check if an income category of 1 is in the lowest quintile
in_lowest_income_quintile(1)
#> [1] 1
# Output: 1
# Multiple respondents
in_lowest_income_quintile(c(3, 1, 5))
#> [1] 2 1 2
# Returns: c(2, 1, 2)
# Database usage: Applied to survey datasets
library(dplyr)
# dataset %>%
# mutate(in_lowest_quintile = in_lowest_income_quintile(income_category))