Skip to content

Commit

Permalink
🔀 Merge branch:dev_hoover into branch:main (#15)
Browse files Browse the repository at this point in the history
* ✨ CSAs and metro divisions now available as a larger geographical unit
* Added `geo_large = 'csa'` for Core Based Statistical Areas and `geo_large = 'metro'` for Metropolitan Divisions as the larger geographical unit in `atkinson()`, `bell()`, `bemanian_beyer()`, `duncan()`, `hoover()`, `sudano()`, and `white()` functions.
* Updated documentation throughout
  • Loading branch information
idblr authored Aug 20, 2024
1 parent 081b2a1 commit 4a4147c
Show file tree
Hide file tree
Showing 30 changed files with 767 additions and 370 deletions.
18 changes: 9 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ndi
Title: Neighborhood Deprivation Indices
Version: 0.1.6.9000
Date: 2024-07-06
Date: 2024-08-19
Authors@R:
c(person(given = "Ian D.",
family = "Buller",
Expand Down Expand Up @@ -31,20 +31,20 @@ Description: Computes various metrics of socio-economic deprivation and disparit
Concentration at the Extremes (ICE) based on Feldman et al. (2015)
<doi:10.1136/jech-2015-205728> and Krieger et al. (2016)
<doi:10.2105/AJPH.2015.302955>, (4) compute the aspatial racial/ethnic
Dissimilarity Index based on Duncan & Duncan (1955) <doi:10.2307/2088328>, (5)
compute the aspatial income or racial/ethnic Atkinson Index based on Atkinson
Dissimilarity Index (DI) based on Duncan & Duncan (1955) <doi:10.2307/2088328>, (5)
compute the aspatial income or racial/ethnic Atkinson Index (AI) based on Atkinson
(1970) <doi:10.1016/0022-0531(70)90039-6>, (6) aspatial racial/ethnic Isolation
Index (II) based on Shevky & Williams (1949; ISBN-13:978-0-837-15637-8) and Bell
(1954) <doi:10.2307/2574118>, (7) aspatial racial/ethnic Correlation Ratio
(1954) <doi:10.2307/2574118>, (7) aspatial racial/ethnic Correlation Ratio (V)
based on Bell (1954) <doi:10.2307/2574118> and White (1986) <doi:10.2307/3644339>,
(8) aspatial racial/ethnic Location Quotient (LQ) based on Merton (1939)
<doi:10.2307/2084686> and Sudano et al. (2013)
<doi:10.1016/j.healthplace.2012.09.015>, (9) aspatial racial/ethnic Local
Exposure and Isolation metric based on Bemanian & Beyer (2017)
<doi:10.1158/1055-9965.EPI-16-0926>, and (10) aspatial racial/ethnic Delta based on
Hoover (1941) <doi:10.1017/S0022050700052980> and Duncan et al. (1961; LC:60007089).
Also using data from the ACS-5 (2005-2009 onward), the package can retrieve the
aspatial Gini Index based Gini (1921) <doi:10.2307/2223319>.
Exposure and Isolation (LEx/Is) metric based on Bemanian & Beyer (2017)
<doi:10.1158/1055-9965.EPI-16-0926>, and (10) aspatial racial/ethnic Delta (DEL)
based on Hoover (1941) <doi:10.1017/S0022050700052980> and Duncan et al. (1961;
LC:60007089). Also using data from the ACS-5 (2005-2009 onward), the package can
retrieve the aspatial Gini Index (G) based Gini (1921) <doi:10.2307/2223319>.
License: Apache License (>= 2.0)
Encoding: UTF-8
LazyData: true
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ importFrom(stringr,str_trim)
importFrom(tidycensus,get_acs)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,separate)
importFrom(tigris,combined_statistical_areas)
importFrom(tigris,core_based_statistical_areas)
importFrom(tigris,metro_divisions)
importFrom(utils,stack)
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### New Features
* Added `hoover()` function to compute the aspatial racial/ethnic Delta (*DEL*) based on [Hoover (1941)](https://doi.org/10.1017/S0022050700052980) and Duncan et al. (1961; LC:60007089)
* Added `geo_large = 'cbsa'` option for computing Core Based Statistical Areas as the larger geographical unit in `atkinson()`, `bell()`, `bemanian_beyer()`, `duncan()`, `hoover()`, `sudano()`, and `white()` functions.
* Added `geo_large = 'cbsa'` for computing Core Based Statistical Areas, `geo_large = 'csa'` for Combined Statistical Areas, and `geo_large = 'metro'` for Metropolitan Divisions as the larger geographical unit in `atkinson()`, `bell()`, `bemanian_beyer()`, `duncan()`, `hoover()`, `sudano()`, and `white()` functions.
* Thank you for the feature suggestions, [Symielle Gaston](https://orcid.org/0000-0001-9495-1592)

### Updates
Expand Down Expand Up @@ -97,7 +97,7 @@
### New Features
* Added `anthopolos()` function to compute the Racial Isolation Index (*RI*) based on based on [Anthopolos et al. (2011)](https://doi.org/10.1016/j.sste.2011.06.002) for specified counties/tracts 2009 onward
* Added `bravo()` function to compute the Educational Isolation Index (*EI*) based on based on [Bravo et al. (2021)](https://doi.org/10.3390/ijerph18179384) for specified counties/tracts 2009 onward
* Added `gini()` function to retrieve the Gini Index based on [Gini (1921)](https://doi.org/10.2307/2223319) for specified counties/tracts 2009 onward
* Added `gini()` function to retrieve the Gini Index (*G*) based on [Gini (1921)](https://doi.org/10.2307/2223319) for specified counties/tracts 2009 onward
* Thank you for the feature suggestions, [Jessica Madrigal](https://orcid.org/0000-0001-5303-5109)

### Updates
Expand Down
50 changes: 25 additions & 25 deletions R/anthopolos.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,41 @@
#' @param quiet Logical. If TRUE, will display messages about potential missing census information. The default is FALSE.
#' @param ... Arguments passed to \code{\link[tidycensus]{get_acs}} to select state, county, and other arguments for census characteristics
#'
#' @details This function will compute the spatial Racial Isolation Index (*RI*) of U.S. census tracts or counties for a specified geographical extent (e.g., the entire U.S. or a single state) based on Anthopolos et al. (2011) \doi{10.1016/j.sste.2011.06.002} who originally designed the metric for the racial isolation of non-Hispanic Black individuals. This function provides the computation of *RI* for any of the U.S. Census Bureau race/ethnicity subgroups (including Hispanic and non-Hispanic individuals).
#' @details This function will compute the spatial Racial Isolation Index (\emph{RI}) of U.S. census tracts or counties for a specified geographical extent (e.g., the entire U.S. or a single state) based on Anthopolos et al. (2011) \doi{10.1016/j.sste.2011.06.002} who originally designed the metric for the racial isolation of non-Hispanic Black individuals. This function provides the computation of \emph{RI} for any of the U.S. Census Bureau race/ethnicity subgroups (including Hispanic and non-Hispanic individuals).
#'
#' The function uses the \code{\link[tidycensus]{get_acs}} function to obtain U.S. Census Bureau 5-year American Community Survey characteristics used for the geospatial computation. The yearly estimates are available for 2009 onward when ACS-5 data are available but are available from other U.S. Census Bureau surveys. The twenty racial/ethnic subgroups (U.S. Census Bureau definitions) are:
#' \itemize{
#' \item **B03002_002**: not Hispanic or Latino \code{'NHoL'}
#' \item **B03002_003**: not Hispanic or Latino, white alone\code{'NHoLW'}
#' \item **B03002_004**: not Hispanic or Latino, Black or African American alone \code{'NHoLB'}
#' \item **B03002_005**: not Hispanic or Latino, American Indian and Alaska Native alone \code{'NHoLAIAN'}
#' \item **B03002_006**: not Hispanic or Latino, Asian alone \code{'NHoLA'}
#' \item **B03002_007**: not Hispanic or Latino, Native Hawaiian and Other Pacific Islander alone \code{'NHoLNHOPI'}
#' \item **B03002_008**: not Hispanic or Latino, Some other race alone \code{'NHoLSOR'}
#' \item **B03002_009**: not Hispanic or Latino, Two or more races \code{'NHoLTOMR'}
#' \item **B03002_010**: not Hispanic or Latino, Two races including Some other race \code{'NHoLTRiSOR'}
#' \item **B03002_011**: not Hispanic or Latino, Two races excluding Some other race, and three or more races \code{'NHoLTReSOR'}
#' \item **B03002_012**: Hispanic or Latino \code{'HoL'}
#' \item **B03002_013**: Hispanic or Latino, white alone \code{'HoLW'}
#' \item **B03002_014**: Hispanic or Latino, Black or African American alone \code{'HoLB'}
#' \item **B03002_015**: Hispanic or Latino, American Indian and Alaska Native alone \code{'HoLAIAN'}
#' \item **B03002_016**: Hispanic or Latino, Asian alone \code{'HoLA'}
#' \item **B03002_017**: Hispanic or Latino, Native Hawaiian and Other Pacific Islander alone \code{'HoLNHOPI'}
#' \item **B03002_018**: Hispanic or Latino, Some other race alone \code{'HoLSOR'}
#' \item **B03002_019**: Hispanic or Latino, Two or more races \code{'HoLTOMR'}
#' \item **B03002_020**: Hispanic or Latino, Two races including Some other race \code{'HoLTRiSOR'}
#' \item **B03002_021**: Hispanic or Latino, Two races excluding Some other race, and three or more races \code{'HoLTReSOR'}
#' \item \strong{B03002_002}: not Hispanic or Latino \code{'NHoL'}
#' \item \strong{B03002_003}: not Hispanic or Latino, white alone\code{'NHoLW'}
#' \item \strong{B03002_004}: not Hispanic or Latino, Black or African American alone \code{'NHoLB'}
#' \item \strong{B03002_005}: not Hispanic or Latino, American Indian and Alaska Native alone \code{'NHoLAIAN'}
#' \item \strong{B03002_006}: not Hispanic or Latino, Asian alone \code{'NHoLA'}
#' \item \strong{B03002_007}: not Hispanic or Latino, Native Hawaiian and Other Pacific Islander alone \code{'NHoLNHOPI'}
#' \item \strong{B03002_008}: not Hispanic or Latino, Some other race alone \code{'NHoLSOR'}
#' \item \strong{B03002_009}: not Hispanic or Latino, Two or more races \code{'NHoLTOMR'}
#' \item \strong{B03002_010}: not Hispanic or Latino, Two races including Some other race \code{'NHoLTRiSOR'}
#' \item \strong{B03002_011}: not Hispanic or Latino, Two races excluding Some other race, and three or more races \code{'NHoLTReSOR'}
#' \item \strong{B03002_012}: Hispanic or Latino \code{'HoL'}
#' \item \strong{B03002_013}: Hispanic or Latino, white alone \code{'HoLW'}
#' \item \strong{B03002_014}: Hispanic or Latino, Black or African American alone \code{'HoLB'}
#' \item \strong{B03002_015}: Hispanic or Latino, American Indian and Alaska Native alone \code{'HoLAIAN'}
#' \item \strong{B03002_016}: Hispanic or Latino, Asian alone \code{'HoLA'}
#' \item \strong{B03002_017}: Hispanic or Latino, Native Hawaiian and Other Pacific Islander alone \code{'HoLNHOPI'}
#' \item \strong{B03002_018}: Hispanic or Latino, Some other race alone \code{'HoLSOR'}
#' \item \strong{B03002_019}: Hispanic or Latino, Two or more races \code{'HoLTOMR'}
#' \item \strong{B03002_020}: Hispanic or Latino, Two races including Some other race \code{'HoLTRiSOR'}
#' \item \strong{B03002_021}: Hispanic or Latino, Two races excluding Some other race, and three or more races \code{'HoLTReSOR'}
#' }
#'
#' Use the internal \code{state} and \code{county} arguments within the \code{\link[tidycensus]{get_acs}} function to specify geographic extent of the data output. NOTE: Current version does not correct for edge effects (e.g., census geographies along the specified spatial extent border, coastline, or U.S.-Mexico / U.S.-Canada border) may have few neighboring census geographies, and *RI* values in these census geographies may be unstable. A stop-gap solution for the former source of edge effect is to compute the *RI* for neighboring census geographies (i.e., the states bordering a study area of interest) and then use the estimates of the study area of interest.
#' Use the internal \code{state} and \code{county} arguments within the \code{\link[tidycensus]{get_acs}} function to specify geographic extent of the data output. NOTE: Current version does not correct for edge effects (e.g., census geographies along the specified spatial extent border, coastline, or U.S.-Mexico / U.S.-Canada border) may have few neighboring census geographies, and \emph{RI} values in these census geographies may be unstable. A stop-gap solution for the former source of edge effect is to compute the \emph{RI} for neighboring census geographies (i.e., the states bordering a study area of interest) and then use the estimates of the study area of interest.
#'
#' A census geography (and its neighbors) that has nearly all of its population who identify with the specified race/ethnicity subgroup(s) (e.g., non-Hispanic or Latino, Black or African American alone) will have an *RI* value close to 1. In contrast, a census geography (and its neighbors) that has nearly none of its population who identify with the specified race/ethnicity subgroup(s) (e.g., not non-Hispanic or Latino, Black or African American alone) will have an *RI* value close to 0.
#' A census geography (and its neighbors) that has nearly all of its population who identify with the specified race/ethnicity subgroup(s) (e.g., non-Hispanic or Latino, Black or African American alone) will have an \emph{RI} value close to 1. In contrast, a census geography (and its neighbors) that has nearly none of its population who identify with the specified race/ethnicity subgroup(s) (e.g., not non-Hispanic or Latino, Black or African American alone) will have an \emph{RI} value close to 0.
#'
#' @return An object of class 'list'. This is a named list with the following components:
#'
#' \describe{
#' \item{\code{ri}}{An object of class 'tbl' for the GEOID, name, *RI*, and raw census values of specified census geographies.}
#' \item{\code{missing}}{An object of class 'tbl' of the count and proportion of missingness for each census variable used to compute *RI*.}
#' \item{\code{ri}}{An object of class 'tbl' for the GEOID, name, \emph{RI}, and raw census values of specified census geographies.}
#' \item{\code{missing}}{An object of class 'tbl' of the count and proportion of missingness for each census variable used to compute \emph{RI}.}
#' }
#'
#' @import dplyr
Expand Down
Loading

0 comments on commit 4a4147c

Please sign in to comment.