Skip to content

Commit

Permalink
✨ Initial commit for branch "dev_denton_cuzzort" (ndi v0.1.6.9012) (#29)
Browse files Browse the repository at this point in the history
* Added `denton_cuzzort()` function to compute the aspatial racial or ethnic Relative Concentration (*RCO*) based on [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281) and Duncan, Cuzzort, & Duncan (1961; LC:60007089)
  • Loading branch information
idblr authored Sep 2, 2024
1 parent 1636f88 commit a8f3c7e
Show file tree
Hide file tree
Showing 43 changed files with 1,593 additions and 606 deletions.
4 changes: 2 additions & 2 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.9011
Date: 2024-08-31
Version: 0.1.6.9012
Date: 2024-09-01
Authors@R:
c(person(given = "Ian D.",
family = "Buller",
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export(bell)
export(bemanian_beyer)
export(bravo)
export(denton)
export(denton_cuzzort)
export(duncan)
export(duncan_cuzzort)
export(duncan_duncan)
Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ndi (development version)

## ndi v0.1.6.9011
## ndi v0.1.6.9012

### New Features

Expand All @@ -13,12 +13,13 @@
* Added `white_blau()` function to compute an index of spatial proximity (*SP*) based on [White (1986)](https://doi.org/10.2307/3644339) and Blau (1977; ISBN-13:978-0-029-03660-0)
* Thank you for the feature suggestions above, [Symielle Gaston](https://orcid.org/0000-0001-9495-1592)
* Added `denton()` function to compute the aspatial racial or ethnic Relative Clustering (*RCL*) based on [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281)
* Added `denton_cuzzort()` function to compute the aspatial racial or ethnic Relative Concentration (*RCO*) based on [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281) and Duncan, Cuzzort, & Duncan (1961; LC:60007089)
* Added `duncan_duncan()` function to compute the aspatial racial or ethnic Relative Centralization (*RCE*) based on [Duncan & Duncan (1955b)](https://doi.org/10.1086/221609) and [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281)
* Added `massey()` function to compute the aspatial racial or ethnic Absolute Clustering (*ACL*) based on [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281)
* Added `massey_duncan()` function to compute the aspatial racial or ethnic Absolute Concentration (*ACO*) based on [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281) and Duncan, Cuzzort, & Duncan (1961; LC:60007089)

#### New Function Capabilities
* Added `geo_large = 'place'` for census-designated places, `geo_large = 'cbsa'` for 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()`, `denton()`, `duncan()`, `duncan_cuzzort()`, `duncan_duncan()`, `hoover()`, `james_taeuber()`, `lieberson()`, `massey()`, `massey_duncan()`, `sudano()`, `theil()`, and `white()`, `white_blau()` functions.
* Added `geo_large = 'place'` for census-designated places, `geo_large = 'cbsa'` for 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()`, `denton()`, `denton_cuzzort()`, `duncan()`, `duncan_cuzzort()`, `duncan_duncan()`, `hoover()`, `james_taeuber()`, `lieberson()`, `massey()`, `massey_duncan()`, `sudano()`, `theil()`, and `white()`, `white_blau()` functions.
* Added census block group computation for `anthopolos()` by specifying `geo == 'cbg'` or `geo == 'block group'`
* Added `holder` argument to `atkinson()` function to toggle the computation with or without the Hölder mean. The function can now compute *A* without the Hölder mean. The default is `holder = FALSE`.
* Added `crs` argument to `anthopolos()`, `bravo()`, and `white_blau()` functions to provide spatial projection of the distance-based metrics
Expand Down
9 changes: 5 additions & 4 deletions R/denton.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ denton <- function(geo_large = 'county',

# Select census variables
vars <- c(
TotalPop = 'B03002_001',
NHoL = 'B03002_002',
NHoLW = 'B03002_003',
NHoLB = 'B03002_004',
Expand All @@ -175,8 +176,8 @@ denton <- function(geo_large = 'county',
HoLTReSOR = 'B03002_021'
)

selected_vars <- vars[c(subgroup, subgroup_ref)]
out_names <- names(selected_vars) # save for output
selected_vars <- vars[c('TotalPop', subgroup, subgroup_ref)]
out_names <- c(names(selected_vars), 'ALAND') # save for output
in_subgroup <- paste0(subgroup, 'E')
in_subgroup_ref <- paste0(subgroup_ref, 'E')

Expand Down Expand Up @@ -330,7 +331,7 @@ denton <- function(geo_large = 'county',
}

# Compute RCL
## From Denton & Massey (1988) https://doi.org/10.1093/sf/67.2.281
## From Massey & Denton (1988) https://doi.org/10.1093/sf/67.2.281
## RCL = P_{xx}/P_{yy}-1
## Where for i & j smaller geographical units:
## P_{xx} = \frac{\sum_{i=1}^{n}\sum_{j=1}^{n}x_{i}x_{j}c_{ij}}{X^{2}}
Expand Down Expand Up @@ -359,7 +360,7 @@ denton <- function(geo_large = 'county',
sf::st_drop_geometry()

# Warning for missingness of census characteristics
missingYN <- out_dat[, c(in_subgroup, in_subgroup_ref)] %>%
missingYN <- out_dat[, c('TotalPopE', in_subgroup, in_subgroup_ref, 'ALAND')] %>%
sf::st_drop_geometry()
names(missingYN) <- out_names
missingYN <- missingYN %>%
Expand Down
Loading

0 comments on commit a8f3c7e

Please sign in to comment.