/
inequality_and_poverty.Rmd
232 lines (195 loc) · 8.96 KB
/
inequality_and_poverty.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
---
title: "Calculating accessibility inequality and poverty"
output: rmarkdown::html_vignette
bibliography: '`r system.file("REFERENCES.bib", package = "accessibility")`'
vignette: >
%\VignetteIndexEntry{Calculating accessibility inequality and poverty}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
Sys.setenv(OMP_THREAD_LIMIT = 2)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
**accessibility** not only includes functions to calculate accessibility levels
from travel time matrices and land use datasets, but also to calculate
accessibility inequality and poverty from an accessibility distribution. This
vignette briefly presents these functions.
# Demonstration on sample data
We first need to calculate the accessibility levels that we are going to use in
this demonstration. To do so, we use the `cumulative_cutoff()` function and the
sample data included in the package.
```{r}
library(accessibility)
data_dir <- system.file("extdata", package = "accessibility")
travel_matrix <- readRDS(file.path(data_dir, "travel_matrix.rds"))
land_use_data <- readRDS(file.path(data_dir, "land_use_data.rds"))
access <- cumulative_cutoff(
travel_matrix,
land_use_data,
opportunity = "jobs",
travel_cost = "travel_time",
cutoff = 30
)
head(access)
```
The functions we’ll be demonstrating in this section take much of the same
information as input, including:
- the accessibility distribution;
- a sociodemographic dataset containing information such as the distribution of
people in the study area and their income;
- the name of the column in the accessibility dataset with the opportunities
whose accessibility should be considered in the calculation; and
- the name of the column in the sociodemographic dataset with the number of
people in each cell, used to weigh accessibility levels when calculating
inequality/poverty.
## Palma Ratio
`palma_ratio()` calculates the Palma Ratio of a given accessibility
distribution. Originally defined as the income share of the wealthiest 10% of a
population divided by the income share of the poorest 40%, this measure has been
adapted in transport planning as the average accessibility of the wealthiest 10%
divided by the average accessibility of the poorest 40%. Palma Ratio values
higher than 1 indicate a scenario in which the wealthiest population has higher
accessibility levels than the poorest, whereas values lower than 1 indicate the
opposite situation.
This function includes an additional `income` parameter, used to list the column
in the sociodemographic dataset with the income variable that should be used to
classify the population in socioeconomic groups. Please note that this variable
should describe income per capita (e.g. mean income per capita, household income
per capita, etc), instead of the total amount of income in each cell.
```{r}
palma <- palma_ratio(
access,
sociodemographic_data = land_use_data,
opportunity = "jobs",
population = "population",
income = "income_per_capita"
)
palma
```
## Gini Index
`gini_index()` calculates the Gini Index of a given accessibility distribution.
Probably the most frequently used inequality measure in transport planning, this
index estimates how much a distribution deviates from a hypothetical situation
in which everyone has the exact same accessibility conditions. Gini Index values
range from 0 to 1. A value of 0 indicates a scenario of perfect
equality, in which everyone has the same accessibility levels, whereas a value
of 1 indicates a scenario of perfect inequality, in which the accessibility
levels in a study area are all concentrated into a single cell.
```{r}
gini <- gini_index(
access,
sociodemographic_data = land_use_data,
opportunity = "jobs",
population = "population"
)
gini
```
## Concentration Index
`concentration_index()` calculates the Concentration Index (CI) of a given
accessibility distribution. This measures estimates the extent to which
accessibility inequalities are systematically associated with individuals'
socioeconomic levels. CI values can theoretically vary between -1 and 1 (when
all accessibility is concentrated in the most or in the least disadvantaged
cell, respectively). Negative values indicate that inequalities favor the poor,
while positive values indicate a pro-rich bias.
Just like `palma_ratio()`, this function includes an `income` parameter to
indicate which variable from the sociodemographic dataset should be used to rank
the population from the least to the most privileged groups. Unlike the Palma
Ratio function, however, any variable that can be used to describe one's
socioeconomic status, such as education level, for example, can be passed to
this argument, as long as it can be numerically ordered (in which higher values
denote higher socioeconomic status).
`concentration_index()` also includes a `type` parameter, used to indicate which
Concentration Index to calculate. This parameter currently supports two values,
`"standard"` and `"corrected"`, which respectively identify the standard
relative CI and the corrected CI, proposed by @erreygers2009correcting.
```{r}
ci <- concentration_index(
access,
sociodemographic_data = land_use_data,
opportunity = "jobs",
population = "population",
income = "income_per_capita",
type = "corrected"
)
ci
```
## Theil T
`theil_t()` calculates the Theil T Index of a given accessibility distribution.
Values range from 0 (when all individuals have exactly the same accessibility
levels) to the natural log of *n*, in which *n* is the number of individuals in
the accessibility dataset.
If the individuals can be classified into mutually exclusive and completely
exhaustive groups (i.e. into groups that do not overlap and cover the entire
population), the index can be decomposed into a between- and a within-groups
inequality component. The function includes a `socioeconomic_groups` parameter
to indicate which variable from the sociodemographic dataset should be used
identify the socioeconomic groups used to calculate these components.
Please note that the output `theil_t()` varies based on the value of
`socioeconomic_groups`. If `NULL` (the default), the between- and within-groups
components are not calculated, and the function returns a data frame containing
only the total aggregate inequality for the returned area. If
`socioeconomic_groups` is not `NULL`, however, the function returns a list
containing three dataframes: one summarizing the total inequality and the
between- and within-groups components, one listing the contribution of each
group to the between-groups component and another listing the contribution of
each group to the within-groups component. Both behaviors are shown below.
```{r}
theil_without_groups <- theil_t(
access,
sociodemographic_data = land_use_data,
opportunity = "jobs",
population = "population"
)
theil_without_groups
# some cells are classified as in the decile NA because their income per capita
# is NaN, as they don't have any population. we filter these cells from our
# accessibility data, otherwise the output would include NA values (note that
# subsetting the data like this doesn't affect the assumption that groups are
# completely exhaustive, because cells with NA income decile don't have any
# population)
na_decile_ids <- land_use_data[is.na(land_use_data$income_decile), ]$id
no_na_access <- access[! access$id %in% na_decile_ids, ]
sociodem_data <- land_use_data[! land_use_data$id %in% na_decile_ids, ]
theil_with_groups <- theil_t(
no_na_access,
sociodemographic_data = sociodem_data,
opportunity = "jobs",
population = "population",
socioeconomic_groups = "income_decile"
)
theil_with_groups
```
## Foster-Greer-Thorbecke (FGT) poverty measures
`fgt_poverty()` calculates the FGT metrics, a family of poverty measures
originally proposed by @foster1984class that capture the extent and severity of
poverty within an accessibility distribution. The FGT family is composed of
three measures that differ based on the $\alpha$ parameter used to calculate
them (either 0, 1 or 2) and which also changes their interpretation:
- with $\alpha = 0$ (FGT0) the measure captures the extent of poverty as a
simple headcount - i.e. the proportion of people below the poverty line;
- with $\alpha = 1$ (FGT1) the measure, also know as the "poverty gap index",
captures the severity of poverty as the average percentage distance between
the poverty line and the accessibility of individuals below the poverty line;
- with $\alpha = 2$ (FGT2) the measure simultaneously captures the extent and
the severity of poverty by calculating the number of people below the poverty
line weighted by the size of the accessibility shortfall relative to the
poverty line.
This function includes an additional `poverty_line` parameter, used to define
the poverty line below which individuals are considered to be in accessibility
poverty.
```{r}
poverty <- fgt_poverty(
access,
sociodemographic_data = land_use_data,
opportunity = "jobs",
population = "population",
poverty_line = 95368
)
poverty
```
# References