Code
if (!require("pacman")) install.packages("pacman")
Loading required package: pacman
Code
::p_load(haven, DescTools, knitr, kableExtra, ineq, ggplot2, formatdown) pacman
Lecture 3: Module 1-Poverty
Harounan Kazianga
Oklahoma State University
Spring 2024
Loading required package: pacman
ED Ch 6
Banerjee, A. and E. Duflo (2007). “The Economic Lives of the Poor”, The Journal of Economic Perspectives. 21(1) pp 141167 (available at the library)
Schultz, T. W. 1979. “Nobel Lecture: The Economics of Being Poor”, Journal of Political Economy. 88(4) pp 639-651 (available at the library)
Foster, Greer, Thorbeke (1984), “A Class of Decomposable Poverty Measures”, Econometrica, 1984
Why care about poverty?
Intrinsic interest
Functional implications for development: human capital, incentives in production, etc.
Poverty as an absolute concept (in contrast to inequality)
We will call someone poor whose measure of well-being is under a certain threshold, the poverty line (in contrast: relative deprivation)
What measure:
income, consumption basket, food consumption, wealth, capabilities?
Static versus dynamic measurement (temporary vs. chronic)
Household or individual level (importance of intra-household inequality)
Starting Point: Poverty line
We call someone poor if her income (or other measure) is below the poverty line
But how to make comparisons among the poor?
This gives rise to the following principles:
Monotonicity Principle:
a reduction in the income of a poor household must increase poverty
Transfer Principle:
a transfer of income from a poor household to any richer household must increase poverty
Transfer Sensitivity Principle:
if a transfer of income takes place from a poor household with income \(y_{i}\) to a poor household with income \(y_{i}+d, d>0,\) then the magnitude of the increase in poverty must be smaller for larger \(y\)
where \(HC\) is the number of individuals with income \(y_{i}\), such that \(y_{i}<Z\), and \(n\) is the size of the population.
\[ PGR=\frac{\sum_{y_{i}<z}(z-y_{i})}{n\mu} \]
We generate \(10\) income observations between \(\$10\) and \(\$120\), and set the poverty line at \(z=\$45\). We calculate and report the headcount ratio, and the poverty gap ratio.
# Set seed for reproducibility
set.seed(123)
# Generate 10 observations with income values from 10 to 120
income <- seq(10, 120, length.out = 10)
#income <- format_decimal(income, 2)
# Set the poverty line
poverty_line <- 45
# Calculate the headcount ratio
headcount_ratio <- sum(income < poverty_line) / length(income)
# Calculate the poverty gap ratio
poverty_gap <- ifelse(income < poverty_line, poverty_line - income, 0)
poverty_gap_ratio <- sum(poverty_gap) / (length(income) * poverty_line)
# Display the results
#print(income)
#print(headcount_ratio)
#print(poverty_gap_ratio)
# Increase poverty in the hypothetical population
income1 <- income
## 1. income fall below 45 for 3 individuals with high income (>45)
### 1.a. Identify observations higher than 45
high_income_indices <- which(income1 > 45)
### 1.b Modify the first 3 observations found to be strictly smaller than 45
#### I choose a value just 44 to ensure they meet the criteria, but feel free to explore with other values
new_y <- 44
income1[high_income_indices[1:3]] <- new_y
# The modified income data is now stored in 'income1'
# print(income1)
# Calculate the headcount ratio
hcr1 <- sum(income1 < poverty_line) / length(income1)
# Calculate the poverty gap ratio
gap1 <- ifelse(income1 < poverty_line, poverty_line - income1, 0)
pgr1 <- sum(gap1) / (length(income1) * poverty_line)
## 2. Income falls for the poor
income2 <- income
low_income_indices <- which(income2 < 45)
### 1.b Modify the first 3 observations found to be strictly smaller than 45
#### I choose a value just 44 to ensure they meet the criteria, but feel free to explore with other values
new_y2 <- 8
income2[low_income_indices[1:3]] <- new_y2
# The modified income data is now stored in 'income1'
#print(income2)
# Calculate the headcount ratio
hcr2 <- sum(income2 < poverty_line) / length(income2)
# Calculate the poverty gap ratio
gap2 <- ifelse(income2 < poverty_line, poverty_line - income2, 0)
pgr2 <- sum(gap2) / (length(income2) * poverty_line)
The new headcount ratio is 0.3, and the new poverty gap ratio is 0.2467
The poverty gap ratio shows that poverty has increased, but the headcount ratio indicates that poverty has not changed.
This illustrates one key limitation of the headcount ratio. It is insensitive to decrease in income of the poor, i.e. to the poor getting poorer. Which principles do you think this measures violates?
Foster-Greer-Thorbeke propose a general class of poverty measures
Most poverty measures (e.g., the HCR, PGR) can be represented as special cases of FGT poverty measures
\[ P_{\alpha}(z)=\frac{1}{n}\sum_{i=1}^{n}\left[ ^{1}\{y_{i}\leq z\}\left( \frac{z-y_{i}}{z}\right) ^{\alpha}\right] \]
For example, if \(\alpha=0\), we obtain the headcount ratio, HCR
Verify that if \(\alpha = 1\), you have the income gap ratio
We will write a R function call “fgt” that we calculate the poverty measure, given the population income, the poverty rate and \(\alpha\).
# Define the FGT poverty measure function
fgt <- function(y, z, alpha) {
# Ensure y is a numeric vector
if (!is.numeric(y)) {
stop("Income data must be numeric.")
}
# Ensure z (poverty line) is numeric and positive
if (!is.numeric(z) || z <= 0) {
stop("Poverty line must be a positive numeric value.")
}
# Ensure alpha is numeric and non-negative
if (!is.numeric(alpha) || alpha < 0) {
stop("Alpha must be a non-negative numeric value.")
}
# Calculate the FGT index
N <- length(y)
poverty_gaps <- ifelse(y < z, ((z - y) / z)^alpha, 0)
fgt_index <- sum(poverty_gaps) / N
return(fgt_index)
}
# Define the poverty line
z <- 45
hcr <- fgt(income, z, 0)
hcr1 <- fgt(income1, z, 0)
hcr2 <- fgt(income2, z, 0)
pgr <- fgt(income, z, 1)
pgr1 <- fgt(income1, z, 1)
pgr2 <- fgt(income2, z, 1)
fgt_version = data.frame(
Measures = c("HCR", "PGR"),
"income" = c(hcr, pgr),
"income1" = c(hcr1, pgr1),
"income2" = c(hcr2, pgr2)
)
kable(fgt_version, format = "html", caption = "Poverty Measures Using FGT", digits = 2, full_width = F, position = "float_top",
format.args = list(big.mark = "," , scientific = FALSE), col.names = c("Poverty Measure", "Income Dist 0", "Income Dist 1", "Income Dist 2" ) )
Poverty Measure | Income Dist 0 | Income Dist 1 | Income Dist 2 |
---|---|---|---|
HCR | 0.30 | 0.60 | 0.30 |
PGR | 0.15 | 0.16 | 0.25 |
The measures are identical to the ones we calculated earlier.
In practice, you do not need to write your own “fgt” function. The package “ineq” we used earlier has a function for calculating poverty measures.
For \(y_{i}\leq z\), \(z-y_{i}\) is the income shortfall, \(\frac{z-y_{i}}{z}\) the relative income shortfall
For \(y_{i}\leq z\), \(\left( \frac{z-y_{i}}{z}\right)^{2}\) is called relative poverty severity
-For \(\alpha=2\), we obtain the poverty-severity measure
You might have noticed this already: \(\alpha\) indicates the weight attached to how far the poor fall from the poverty line
The FGT can be decomposed to examine how different social groups contribute to overall poverty
Suppose we are given information on poverty in \(J\) different subgroups (each with population \(n_{j}\)) of a population of size \(n\)
We aggregate subgroup poverty into total poverty
\[ P_{\alpha}^{total}=\sum_{j=1}^{J}\frac{n_{j}}{n}P_{\alpha}^{j}% \]
# create new income data (groups3)
groups3 <- data.frame(
income = c(income, income1, income2),
group = c(rep("A", length(income)), rep("B", length(income1)), rep("C", length(income2)) )
)
# alpha = 0, the headcount ratio
alpha <- 0
# Calculate overall poverty measure for the 3 groups dataset
overall_fgt <- fgt(groups3$income, z, alpha)
# Calculate poverty measure for each group separately and use decomposability property
groups <- unique(groups3$group)
decomposed_fgt <- 0
total_population <- nrow(groups3)
for (group in groups) {
group_data <- groups3[groups3$group == group, ]
group_fgt <- fgt(group_data$income, z, alpha)
decomposed_fgt <- decomposed_fgt + (nrow(group_data) / total_population) * group_fgt
}
For \(\alpha\) = 0, applying the fgt function to the 3 groups (30 observations), we find that the poverty index is 0.4. We find the identical value using the decomposability property, i.e. 0.4.
Sometimes, we are interested in how much specific groups (e.g., regions, ethnic groups, etc.) contribute to overall poverty.
# Initialize a list to store group-specific FGT measures and populations
group_fgt_list <- list()
# Calculate FGT for each group
groups <- unique(groups3$group)
for (group in groups) {
group_data <- groups3[groups3$group == group,]
group_fgt <- fgt(group_data$income, z, alpha)
group_fgt_list[[group]] <- list(fgt = group_fgt, population = nrow(group_data))
}
total_population <- nrow(groups3)
total_fgt <- sum(sapply(group_fgt_list, function(x) x$population / total_population * x$fgt))
# Calculate and print each group's contribution
for (group in names(group_fgt_list)) {
group_contribution <- group_fgt_list[[group]]$population / total_population * group_fgt_list[[group]]$fgt / total_fgt * 100
cat(group, "contribution to total poverty index:", group_contribution, "%\n")
}
A contribution to total poverty index: 25 %
B contribution to total poverty index: 50 %
C contribution to total poverty index: 25 %
For \(\alpha = 0\) (the headcount ratio), the total poverty index is 0.4, and the contribution of each group to total poverty is as shown above. In this case, most poverty comes from \(\text{Group B}\). What if \(\alpha = 1\) (poverty gap index)
# Initialize a list to store group-specific FGT measures and populations
alpha = 1
group_fgt_list <- list()
# Calculate FGT for each group
groups <- unique(groups3$group)
for (group in groups) {
group_data <- groups3[groups3$group == group,]
group_fgt <- fgt(group_data$income, z, alpha)
group_fgt_list[[group]] <- list(fgt = group_fgt, population = nrow(group_data))
}
total_population <- nrow(groups3)
total_fgt <- sum(sapply(group_fgt_list, function(x) x$population / total_population * x$fgt))
# Calculate and print each group's contribution
for (group in names(group_fgt_list)) {
group_contribution <- group_fgt_list[[group]]$population / total_population * group_fgt_list[[group]]$fgt / total_fgt * 100
cat(group, "contribution to total poverty index:", group_contribution, "%\n")
}
A contribution to total poverty index: 27.26 %
B contribution to total poverty index: 28.46 %
C contribution to total poverty index: 44.28 %
The total poverty index is 0.1857, and the contribution of each group to total poverty is as shown above. In this case, most poverty comes from \(\text{Group C}\).
Let know move to real world data. We use the Tanzania’s data to illustrate the poverty measures. Different poverty lines can be used. I convert the expenditures per adult equivalent per day in USD. We use the international poverty line of $\$1.9$ per day per adult equivalent. Notice that for this exercise, I use the exchange rate method. The actual poverty rates would be lower with purchasing power parity method.
# Load, clean and filter the data
library(haven)
library(DescTools)
data <- read_dta("C:/Users/harouna/OneDrive - Oklahoma A and M System/OSU/Spring2024/ECON4643_Spring2024/Data/Assignments/Assignment1/Assignment1_Data.dta")
## filter out observations with 0 expenditures
data <- subset(data, expmR_pae > 0 & year == 2009)
## Winsorize hhexpensesR at the 2nd and 98th percentiles
data$area <- factor(data$area,
levels = c(1, 2, 3, 4),
labels = c("Dar es Salaam", "Rest of urban", "Rural", "Zanzibar"))
z <- 1.9
#z <- 36482
hcrT <- fgt(data$expmR_pae, z, 0)
hcr1 <- fgt(data$expmR_pae[data$area=="Dar es Salaam"], z, 0)
hcr2 <- fgt(data$expmR_pae[data$area=="Rest of urban"], z, 0)
hcr3 <- fgt(data$expmR_pae[data$area=="Rural"], z, 0)
hcr4 <- fgt(data$expmR_pae[data$area=="Zanzibar"], z, 0)
pgrT <- fgt(data$expmR_pae, z, 1)
pgr1 <- fgt(data$expmR_pae[data$area=="Dar es Salaam"], z, 1)
pgr2 <- fgt(data$expmR_pae[data$area=="Rest of urban"], z, 1)
pgr3 <- fgt(data$expmR_pae[data$area=="Rural"], z, 1)
pgr4 <- fgt(data$expmR_pae[data$area=="Zanzibar"], z, 1)
psrT <- fgt(data$expmR_pae, z, 2)
psr1 <- fgt(data$expmR_pae[data$area=="Dar es Salaam"], z, 2)
psr2 <- fgt(data$expmR_pae[data$area=="Rest of urban"], z, 2)
psr3 <- fgt(data$expmR_pae[data$area=="Rural"], z, 2)
psr4 <- fgt(data$expmR_pae[data$area=="Zanzibar"], z, 2)
poverty= data.frame(
Measures = c("HCR", "PGR", "Squared PGR"),
"Tanzania" = c(hcrT, pgrT, psrT),
"Area1" = c(hcr1, pgr1, psr1),
"Area2" = c(hcr2, pgr2, psr2),
"Area3" = c(hcr3, pgr3, psr3),
"Area4" = c(hcr4, pgr4, psr4)
)
kable(poverty, format = "html", caption = "Poverty Indices in Tanzania", digits = 2, full_width = F, position = "float_top",
format.args = list(big.mark = "," , scientific = FALSE), col.names =
c("Poverty Measure", "Tanzania", "Dar es Salaam", "Rest of urban", "Rural", "Zanzibar" ) )
Poverty Measure | Tanzania | Dar es Salaam | Rest of urban | Rural | Zanzibar |
---|---|---|---|---|---|
HCR | 0.75 | 0.32 | 0.67 | 0.89 | 0.83 |
PGR | 0.37 | 0.10 | 0.28 | 0.47 | 0.41 |
Squared PGR | 0.21 | 0.05 | 0.15 | 0.28 | 0.24 |
# Initialize a list to store group-specific FGT measures and populations
alpha = 0
group_fgt_list <- list()
# Calculate FGT for each group
groups <- unique(data$area)
for (area in groups) {
group_data <- data[data$area == area,]
group_fgt <- fgt(group_data$expmR_pae, z, alpha)
group_fgt_list[[area]] <- list(fgt = group_fgt, population = nrow(group_data))
}
total_population <- nrow(data)
total_fgt <- sum(sapply(group_fgt_list, function(x) x$population / total_population * x$fgt))
# Calculate and print each group's contribution
for (group in names(group_fgt_list)) {
group_contribution <- group_fgt_list[[group]]$population / total_population * group_fgt_list[[group]]$fgt / total_fgt * 100
cat(group, "contribution to total poverty index:", group_contribution, "%\n")
}
Rural contribution to total poverty index: 63.54 %
Rest of urban contribution to total poverty index: 13.11 %
Dar es Salaam contribution to total poverty index: 7.146 %
Zanzibar contribution to total poverty index: 16.2 %
# Initialize a list to store group-specific FGT measures and populations
alpha = 1
group_fgt_list <- list()
# Calculate FGT for each group
groups <- unique(data$area)
for (area in groups) {
group_data <- data[data$area == area,]
group_fgt <- fgt(group_data$expmR_pae, z, alpha)
group_fgt_list[[area]] <- list(fgt = group_fgt, population = nrow(group_data))
}
total_population <- nrow(data)
total_fgt <- sum(sapply(group_fgt_list, function(x) x$population / total_population * x$fgt))
# Calculate and print each group's contribution
for (group in names(group_fgt_list)) {
group_contribution <- group_fgt_list[[group]]$population / total_population * group_fgt_list[[group]]$fgt / total_fgt * 100
cat(group, "contribution to total poverty index:", group_contribution, "%\n")
}
Rural contribution to total poverty index: 67.8 %
Rest of urban contribution to total poverty index: 11.13 %
Dar es Salaam contribution to total poverty index: 4.731 %
Zanzibar contribution to total poverty index: 16.34 %
# Initialize a list to store group-specific FGT measures and populations
alpha = 2
group_fgt_list <- list()
# Calculate FGT for each group
groups <- unique(data$area)
for (area in groups) {
group_data <- data[data$area == area,]
group_fgt <- fgt(group_data$expmR_pae, z, alpha)
group_fgt_list[[area]] <- list(fgt = group_fgt, population = nrow(group_data))
}
total_population <- nrow(data)
total_fgt <- sum(sapply(group_fgt_list, function(x) x$population / total_population * x$fgt))
# Calculate and print each group's contribution
for (group in names(group_fgt_list)) {
group_contribution <- group_fgt_list[[group]]$population / total_population * group_fgt_list[[group]]$fgt / total_fgt * 100
cat(group, "contribution to total poverty index:", group_contribution, "%\n")
}
Rural contribution to total poverty index: 69.48 %
Rest of urban contribution to total poverty index: 10.19 %
Dar es Salaam contribution to total poverty index: 3.776 %
Zanzibar contribution to total poverty index: 16.55 %
Poverty is a dynamic condition: individuals can move into and out of poverty, stay poor or non-poor permanently. Alongside the never poor, individuals can be categorized into four groups based on how vulnerable they are from one period to the next (e.g., from one year to the next).
Transitory or temporary poor: individuals with an average income above the poverty line but who may occasionally fall into poverty due to low vulnerability and unlikely year-to-year poverty experiences.
Chronic poor: individuals who are consistently below the poverty line but may occasionally rise above it, facing a high likelihood of experiencing poverty annually due to their vulnerability (also know as temporary poor)
Persistent poor: individuals who always live below the poverty line, facing the highest vulnerability with a certainty of being in poverty every year.
Non-poor: individuals who are always above the poverty line.
Jalan = data.frame(
Category = c("never poor", "transitory poor", "chronic poor", "persistent poor"),
"Percentage" = c(41, 36, 18, 5)
)
kable(Jalan, format = "html", digits = 2, full_width = F, position = "float_top",
format.args = list(big.mark = "," , scientific = FALSE), col.names = c("Category", "Percentage" ) )
Category | Percentage |
---|---|
never poor | 41 |
transitory poor | 36 |
chronic poor | 18 |
persistent poor | 5 |