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.
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.
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:
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.
palma <- palma_ratio( access, sociodemographic_data = land_use_data, opportunity = "jobs", population = "population", income = "income_per_capita" ) palma
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.
gini <- gini_index( access, sociodemographic_data = land_use_data, opportunity = "jobs", population = "population" ) gini
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.
ci <- concentration_index( access, sociodemographic_data = land_use_data, opportunity = "jobs", population = "population", income = "income_per_capita", type = "corrected" ) ci
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.
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
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:
This function includes an additional poverty_line
parameter, used to define
the poverty line below which individuals are considered to be in accessibility
poverty.
poverty <- fgt_poverty( access, sociodemographic_data = land_use_data, opportunity = "jobs", population = "population", poverty_line = 95368 ) poverty
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.