View source: R/dep_get_index.R
dep_get_index | R Documentation |
Downloads raw data and then calculates various measures of
deprivation and/or vulnerability, including a range of options for structuring output. The
included measures include four versions of the CDC's social vulnerability
index, which is a unique offering, along with wrappers that bring in
additional measures from related packages: the area deprivation index
(ADI; via sociome
), gini coefficient (via tidycensus
), and
the neighborhood deprivation index (NDI; via ndi
). Both ADI and NDI
contain variations as well. See Details for more information.
dep_get_index(geography, index, year, survey = "acs5",
return_percentiles = FALSE, keep_subscales = FALSE,
keep_components = FALSE, output = "wide",
state = NULL, county = NULL, puerto_rico = FALSE, zcta = NULL,
zcta_geo_method = NULL, zcta_cb = FALSE, zcta3_method = NULL,
shift_geo = FALSE, key = NULL)
geography |
A character scalar; one of |
index |
A character scalar or vector listing deprivation measures
to return. These include the area deprivation index ( |
year |
A numeric scalar or vector. 2010 is earliest year |
survey |
A character scalar representing the Census product. It can
be any American Community Survey product (either |
return_percentiles |
A logical scalar; if |
keep_subscales |
A logical scalar; if |
keep_components |
A logical scalar; if |
output |
A character scalar; if |
state |
A character scalar or vector with character state abbreviations
(e.x. |
county |
A character scalar or vector with character GEOIDs (e.x.
|
puerto_rico |
A logical scalar; if |
zcta |
An optional vector of ZCTAs that demographic data are requested
for. If this is |
zcta_geo_method |
A character scalar; if |
zcta_cb |
A logical scalar; if This argument does not apply to |
zcta3_method |
A character scalar; if |
shift_geo |
A logical scalar; if |
key |
A Census API key, which can be obtained at
https://api.census.gov/data/key_signup.html. This can be omitted if
|
deprivateR
provides a unique implementation of the Centers
for Disease Control's Social Vulnerability Index at a greater range
of years and geographies than the CDC originally supported. Four versions
of the SVI are offered:
"svi10"
The CDC's 2010 SVI vintage did not include a measure
of civilians with a disability, unlike their later vintages. This version
can be calculated using deprivateR
for each year from 2010 through
2021.
"svi14"
The CDC's 2014, 2016, and 2018 vintages added the
measure of civilians with a disability to their SVI calculations. The
disability measure was added to the American Community Survey beginning
in 2012, so this version can be calculated using deprivateR
for
each year from 2012 through 2021.
"svi20"
The CDC's 2020 vintage made multiple substantive
changes to how SVI is calculated that changed the underlying data
used for the first three of the four themes. In the SES theme: (1) per
capita income was replaced with a measure of housing burden; (2) poverty
was converted to 150
insurance. The Household Composition & Disability (HCD) theme was renamed
Household Characteristics (HOU), and the English language proficiency measure
was moved here from the former Minority Status and Language (MSL) theme.
Since the English language measure was removed from MSL theme, it was
renamed Racial & Ethnic Minority Status (REM). Though the CDC released
this definition with their 2020 data, the underlying data can be
accessed from the American Community Survey from 2012 onward. This means
that this version can be calculated using deprivateR
for
each year from 2012 through 2021.
"svi20s"
The CDC's 2020 vintage changed the variables
used to calculate the number of single-parent households. Their new
approach does not have the backward compatibility that the other
changes made in 2020 do. This version of SVI uses the same underlying
data for single-parent households that the CDC's 2020 vintage does,
along with the other changes made in 2020. This version can be
calculated using deprivateR
for each year from 2012 through
2019.
In addition, wrappers to the sociome
, ndi
, and tidycensus
package create a single point of departure for comparative work using multiple
measures of deprivation or inequality.
A tibble with the requested deprivation measures. The number of columns
and rows depends upon the input arguments. If output = "wide"
, the
number of columns will be equal to the number of deprivation measures
requested plus the number of columns needed to store the geographic
information. Each unique combination of jurisdiction and year will receive
its own row.
If output = "tidy"
, the number of columns will be equal
to the number of deprivation measures requested plus the number of columns
needed to store the geographic information. Each unique combination of
jurisdiction and year will receive its own row. Each unique combination of
jurisdiction, year, and deprivation measure will receive its own row.
# calculate ADI for all US counties
dep_get_index(geography = "county", index = "adi", year = 2022)
# calculate two forms of SVI for all Missouri ZCTAs
dep_get_index(geography = "zcta5", index = c("svi20", "svi20s"), year = 2022,
state = "MO")
# calculate ADI and two forms of NDI for all US counties over three years
# percentiles are returned to ease comparison
dep_get_index(geography = "county", index = c("adi", "svi14"),
year = c(2018:2020), return_percentiles = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.