From 87c2246833d251137e7e4c4e6bf7298440626c8d Mon Sep 17 00:00:00 2001 From: Ian D Buller Date: Fri, 30 May 2025 12:40:59 -0400 Subject: [PATCH 1/5] :hammer: Prepare for PR (#32) * `Hmisc` now Imports --- DESCRIPTION | 3 ++- NAMESPACE | 1 + NEWS.md | 4 ++-- R/ndi-package.R | 1 + cran-comments.md | 2 +- inst/CITATION | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index beb4e11..992cc63 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ndi Title: Neighborhood Deprivation Indices -Version: 0.1.6.9015 +Version: 0.1.6.9016 Date: 2025-05-30 Authors@R: c(person(given = "Ian D.", @@ -38,6 +38,7 @@ Depends: Imports: car, dplyr, + Hmisc, MASS, Matrix, psych, diff --git a/NAMESPACE b/NAMESPACE index fca523d..7c9c88f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -26,6 +26,7 @@ export(theil) export(white) export(white_blau) import(dplyr) +importFrom(Hmisc,wtd.quantile) importFrom(MASS,ginv) importFrom(Matrix,sparseMatrix) importFrom(car,logit) diff --git a/NEWS.md b/NEWS.md index 4f1df9e..01563f1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # ndi (development version) -## ndi v0.1.6.9015 +## ndi v0.1.6.9016 ### New Features @@ -40,7 +40,7 @@ * Output of racial or ethnic residential segregation indices is now rounded to four significant digits #### New Dependencies -* `tigris` and `units` are now Imports +* `Hmisc`, `tigris`, and `units` are now Imports #### Updated Documentation * Split up vignette into three separate vignettes: 'ndi1', 'ndi2', and 'ndi3' for the *NDI*, racial or ethnic residential segregation, and additional socioeconomic disparity indices, respectively diff --git a/R/ndi-package.R b/R/ndi-package.R index 5a55dea..8511dd9 100644 --- a/R/ndi-package.R +++ b/R/ndi-package.R @@ -94,6 +94,7 @@ #' @import dplyr #' @importFrom car logit +#' @importFrom Hmisc wtd.quantile #' @importFrom MASS ginv #' @importFrom Matrix sparseMatrix #' @importFrom psych alpha principal diff --git a/cran-comments.md b/cran-comments.md index ca6f1d1..a632574 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -26,7 +26,7 @@ * Fixed bug in `atkinson()` function to properly compute the income Atkinson Index * Renamed *AI* as *A*, *DI* as *D*, *Gini* as *G*, and *II* as _xPy\*_ to align with the definitions from [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281). The output for `atkinson()` now produces `a` instead of `ai`. The output for `duncan()` now produces `d` instead of `ai`. The output for `gini()` now produces `g` instead of `gini`. The output for `bell()` now produces `xPy_star` instead of `II`. The internal functions `ai_fun()`, `di_fun()` and `ii_fun()` were renamed `a_fun()`, `ddd_fun()` and `xpy_star_fun()`, respectively. * Output of racial or ethnic residential segregation indices is now rounded to four significant digits - * `tigris` and `units` are now Imports + * `Hmisc`, `tigris`, and `units` are now Imports * Reformatted functions for consistent internal structure * 'package.R' deprecated. Replaced with 'ndi-package.R' and reordered the contents * Consolidated DESCRIPTION diff --git a/inst/CITATION b/inst/CITATION index 2c6d77a..76d5dc1 100755 --- a/inst/CITATION +++ b/inst/CITATION @@ -3,7 +3,7 @@ bibentry(bibtype = 'manual', author = as.person('Ian D. Buller'), publisher = 'The Comprehensive R Archive Network', year = '2025', - number = '0.1.6.9015.', + number = '0.1.6.9016.', doi = '10.32614/CRAN.package.ndi', url = 'https://cran.r-project.org/package=ndi', From b7bedd7346d52064d5e756c6e10b054f8dac1215 Mon Sep 17 00:00:00 2001 From: Hunter Mills Date: Fri, 30 May 2025 13:10:55 -0700 Subject: [PATCH 2/5] :bug: Fix to `powell_wiley()` categorical outcome (PR #32) * Updated population-weighted quantile method from `stats::quantile` to `Hmisc::wtd.quantile` * Updated import statement in `powell_wiley()` --- R/powell_wiley.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/R/powell_wiley.R b/R/powell_wiley.R index d0af3f1..861f8c4 100644 --- a/R/powell_wiley.R +++ b/R/powell_wiley.R @@ -55,10 +55,11 @@ #' @import dplyr #' @importFrom MASS ginv #' @importFrom psych alpha principal -#' @importFrom stats complete.cases cor cov2cor loadings median promax quantile sd +#' @importFrom stats complete.cases cor cov2cor loadings median promax sd #' @importFrom stringr str_trim #' @importFrom tidycensus get_acs #' @importFrom tidyr pivot_longer separate +#' @importFrom Hmisc wtd.quantile #' @export #' #' @examples @@ -350,9 +351,10 @@ powell_wiley <- function(geo = 'tract', NDIQuint <- ndi_data_NDI %>% dplyr::mutate( NDIQuint = cut( - NDI * log(TotalPop), - breaks = stats::quantile( - NDI * log(TotalPop), + NDI, + breaks = Hmisc::wtd.quantile( + NDI, + weights = TotalPop, probs = c(0, 0.2, 0.4, 0.6, 0.8, 1), na.rm = TRUE ), From 072eddd60caa70431efc7bdbf80d0696273d39de Mon Sep 17 00:00:00 2001 From: Ian D Buller Date: Fri, 30 May 2025 16:24:27 -0400 Subject: [PATCH 3/5] :memo: Additional documentation for PR #32 --- NEWS.md | 1 + R/powell_wiley.R | 4 ++-- README.md | 2 ++ cran-comments.md | 1 + man/powell_wiley.Rd | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 01563f1..d828c91 100644 --- a/NEWS.md +++ b/NEWS.md @@ -32,6 +32,7 @@ #### Bug Fixes * Fixed NOTE in CRAN checks to provide package anchors for Rd \link{} targets not in the package itself and the base packages within 'ndi-package.Rd' +* Updated population-weighted quantile method from `stats::quantile` to `Hmisc::wtd.quantile` in `powell_wiley()` thanks to a contribution (#32) by [Hunter Miller](https://github.com/huntermills707) * `bell()` function computes the Interaction Index (Bell) not the Isolation Index as previously documented. Updated documentation throughout. * Fixed bug in `bell()`, `bemanian_beyer()`, `duncan()`, `sudano()`, and `white()` functions when a smaller geography contains n=0 total population, will assign a value of zero (0) in the internal calculation instead of NA * Fixed bug in `atkinson()` function to properly compute the income Atkinson Index diff --git a/R/powell_wiley.R b/R/powell_wiley.R index 861f8c4..a694a26 100644 --- a/R/powell_wiley.R +++ b/R/powell_wiley.R @@ -31,7 +31,7 @@ #' #' Use the internal \code{state} and \code{county} arguments within the \code{\link[tidycensus]{get_acs}} function to specify the referent for standardizing the \emph{NDI} (Powell-Wiley) values. For example, if all U.S. states are specified for the \code{state} argument, then the output would be a U.S.-standardized index. Please note: the \emph{NDI} (Powell-Wiley) values will not exactly match (but will highly correlate with) those found in Andrews et al. (2020) \doi{10.1080/17445647.2020.1750066} and Slotman et al. (2022) \doi{10.1016/j.dib.2022.108002} because the two studies used a different statistical platform (i.e., SPSS and SAS, respectively) that intrinsically calculate the principal component analysis differently from R. #' -#' The categorical \emph{NDI} (Powell-Wiley) values are population-weighted quintiles of the continuous \emph{NDI} (Powell-Wiley) values. +#' The categorical \emph{NDI} (Powell-Wiley) values are population-weighted quintiles of the continuous \emph{NDI} (Powell-Wiley) values. NOTE: As of version 0.1.6, population-weighted quintiles are computed using a weighted quantile function \code{\link[Hmisc]{wtd.quantile}} where values are calculated NDI and weights are Total Population instead of previously using \code{\link[stats]{quantile}} of the product of the calculated NDI and natural logarithm transformed total population. #' #' Check if the proportion of variance explained by the first principal component is high (more than 0.5). #' @@ -53,13 +53,13 @@ #' @references Slotman, BA, Stinchcomb, DG, Powell-Wiley, TM, Ostendorf, DM, Saelens, BE, Gorin, AA, Zenk, SN, & Berrigan, D (2022) Environmental Data and Methods from the Accumulating Data to Optimally Predict Obesity Treatment (ADOPT) Core Measures Environmental Working Group. \emph{Data in Brief}, 41:108002. \doi{10.1016/j.dib.2022.108002} #' #' @import dplyr +#' @importFrom Hmisc wtd.quantile #' @importFrom MASS ginv #' @importFrom psych alpha principal #' @importFrom stats complete.cases cor cov2cor loadings median promax sd #' @importFrom stringr str_trim #' @importFrom tidycensus get_acs #' @importFrom tidyr pivot_longer separate -#' @importFrom Hmisc wtd.quantile #' @export #' #' @examples diff --git a/README.md b/README.md index 5ce71cf..0aec613 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,8 @@ See also the list of [contributors](https://github.com/idblr/ndi/graphs/contribu * **Jessica Gleason** - *Epidemiology Branch, Division of Population Health Research, Eunice Kennedy Shriver National Institute of Child Health and Human Development, National Institutes of Health, Bethesda, Maryland* - [ORCID](https://orcid.org/0000-0001-9877-7931) +* **Hunter Mills** - [GitHub](https://github.com/huntermills707) + * **Chris Prener** - *Real World Evidence Center of Excellence, Pfizer, Inc.* - [GitHub](https://github.com/chris-prener) - [ORCID](https://orcid.org/0000-0002-4310-9888) * **Davis Vaughan** - *Posit* - [GitHub](https://github.com/DavisVaughan) - [ORCID](https://orcid.org/0000-0003-4777-038X) diff --git a/cran-comments.md b/cran-comments.md index a632574..edb2f0d 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -21,6 +21,7 @@ * The `gini()` function now computes the aspatial racial or ethnic Gini Index (*G*) based on [Gini (1921)](https://doi.org/10.2307/2223319) as the main outcome. Arguments `geo_large`, `geo_small`, `subgroup`, and `omit_NAs` were added and argument `geo` was deprecated. The `gini()` function still retrieves the original output of the aspatial income Gini Index (*G*) at each smaller geography and is moved from the `g` output to `g_data` output. * Specifying census block groups in `geo` or `geo_small` arguments is now `'block group'` or `'cbg'` to match internal `get_acs()` function from the [tidycensus](https://CRAN.R-project.org/package=tidycensus) package * Fixed NOTE in CRAN checks to provide package anchors for Rd \link{} targets not in the package itself and the base packages within 'ndi-package.Rd' + * Updated population-weighted quantile method from `stats::quantile` to `Hmisc::wtd.quantile` in `powell_wiley()` * `bell()` function computes the Interaction Index (Bell) not the Isolation Index as previously documented. Updated documentation throughout. * Fixed bug in `bell()`, `bemanian_beyer()`, `duncan()`, `sudano()`, and `white()` functions when a smaller geography contains n=0 total population, will assign a value of zero (0) in the internal calculation instead of NA * Fixed bug in `atkinson()` function to properly compute the income Atkinson Index diff --git a/man/powell_wiley.Rd b/man/powell_wiley.Rd index 7393a21..01ac87d 100644 --- a/man/powell_wiley.Rd +++ b/man/powell_wiley.Rd @@ -64,7 +64,7 @@ The function uses the \code{\link[tidycensus]{get_acs}} function to obtain U.S. Use the internal \code{state} and \code{county} arguments within the \code{\link[tidycensus]{get_acs}} function to specify the referent for standardizing the \emph{NDI} (Powell-Wiley) values. For example, if all U.S. states are specified for the \code{state} argument, then the output would be a U.S.-standardized index. Please note: the \emph{NDI} (Powell-Wiley) values will not exactly match (but will highly correlate with) those found in Andrews et al. (2020) \doi{10.1080/17445647.2020.1750066} and Slotman et al. (2022) \doi{10.1016/j.dib.2022.108002} because the two studies used a different statistical platform (i.e., SPSS and SAS, respectively) that intrinsically calculate the principal component analysis differently from R. -The categorical \emph{NDI} (Powell-Wiley) values are population-weighted quintiles of the continuous \emph{NDI} (Powell-Wiley) values. +The categorical \emph{NDI} (Powell-Wiley) values are population-weighted quintiles of the continuous \emph{NDI} (Powell-Wiley) values. NOTE: As of version 0.1.6, population-weighted quintiles are computed using a weighted quantile function \code{\link[Hmisc]{wtd.quantile}} where values are calculated NDI and weights are Total Population instead of previously using \code{\link[stats]{quantile}} of the product of the calculated NDI and natural logarithm transformed total population. Check if the proportion of variance explained by the first principal component is high (more than 0.5). From 5ef9887ddf6c75ce50412b54b3177ee98e4c8a24 Mon Sep 17 00:00:00 2001 From: Ian D Buller Date: Fri, 29 Aug 2025 01:30:22 -0400 Subject: [PATCH 4/5] Prepare for CRAN v0.2.0 release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛 Fixed NOTE in CRAN checks to provide package anchors for Rd `\link{}` targets not in the package itself and the base packages within 'ndi-package.Rd' * 📝 In 'cran-comments.md': added valid URLs, updated test environments, and OK'd author formatting * 📛 Updated DOI badge * 📝 Updated vignettes with latest package version --- DESCRIPTION | 4 +- NEWS.md | 4 +- R/ndi-package.R | 4 +- R/powell_wiley.R | 2 +- README.md | 4 +- cran-comments.md | 34 +++++++++++----- inst/CITATION | 4 +- man/ndi-package.Rd | 2 +- man/powell_wiley.Rd | 2 +- vignettes/ndi1.Rmd | 24 +++++------ vignettes/ndi1.html | 96 ++++++++++++++++++++++--------------------- vignettes/ndi2.html | 99 +++++++++++++++++++++++---------------------- vignettes/ndi3.html | 61 +++++++++++++++------------- 13 files changed, 182 insertions(+), 158 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 992cc63..6f63a86 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: ndi Title: Neighborhood Deprivation Indices -Version: 0.1.6.9016 -Date: 2025-05-30 +Version: 0.2.0 +Date: 2025-08-29 Authors@R: c(person(given = "Ian D.", family = "Buller", diff --git a/NEWS.md b/NEWS.md index d828c91..d71bc70 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # ndi (development version) -## ndi v0.1.6.9016 +## ndi v0.2.0 ### New Features @@ -31,7 +31,7 @@ ### Updates #### Bug Fixes -* Fixed NOTE in CRAN checks to provide package anchors for Rd \link{} targets not in the package itself and the base packages within 'ndi-package.Rd' +* Fixed NOTE in CRAN checks to provide package anchors for Rd `\link{}` targets not in the package itself and the base packages within 'ndi-package.Rd' * Updated population-weighted quantile method from `stats::quantile` to `Hmisc::wtd.quantile` in `powell_wiley()` thanks to a contribution (#32) by [Hunter Miller](https://github.com/huntermills707) * `bell()` function computes the Interaction Index (Bell) not the Isolation Index as previously documented. Updated documentation throughout. * Fixed bug in `bell()`, `bemanian_beyer()`, `duncan()`, `sudano()`, and `white()` functions when a smaller geography contains n=0 total population, will assign a value of zero (0) in the internal calculation instead of NA diff --git a/R/ndi-package.R b/R/ndi-package.R index 8511dd9..9c24c76 100644 --- a/R/ndi-package.R +++ b/R/ndi-package.R @@ -83,14 +83,14 @@ #' @name ndi-package #' @aliases ndi-package ndi #' -#' @section Dependencies: The 'ndi' package relies heavily upon \code{\link[tidycensus]{tidycensus}} to retrieve data from the U.S. Census Bureau American Community Survey five-year estimates and the \code{\link[psych]{psych}} for computing the neighborhood deprivation indices. The \code{\link{messer}} function builds upon code developed by Hruska et al. (2022) \doi{10.17605/OSF.IO/M2SAV} by fictionalizing, adding the percent of households earning <$30,000 per year to the \emph{NDI} computation, and providing the option for computing the ACS-5 2006-2010 \emph{NDI} values. There is no code companion to compute \emph{NDI} included in Andrews et al. (2020) \doi{10.1080/17445647.2020.1750066} or Slotman et al. (2022) \doi{10.1016/j.dib.2022.108002}, but the package author worked directly with the Slotman et al. (2022) \doi{10.1016/j.dib.2022.108002} authors to replicate their SAS code in \strong{R}. The indices of racial or ethnic residential segregation rely heavily on the \code{\link[sf]{sf}} and \code{\link[tigris]{tigris}} packages to assign the smaller geographical units within larger geographical units and, occasionally, perform geospatial projection for distance-based metrics. The computation of \emph{RI} and \emph{EI} also relies on the \code{\link[Matrix]{Matrix}} package to compute the geospatial adjacency matrix between census geographies. Internal function to calculate \emph{AI} using the Hölder mean is based on \code{\link[DescTools]{Atkinson}} function. +#' @section Dependencies: The 'ndi' package relies heavily upon \code{\link[tidycensus]{tidycensus-package}} to retrieve data from the U.S. Census Bureau American Community Survey five-year estimates and the \code{\link[psych]{psych-package}} for computing the neighborhood deprivation indices. The \code{\link{messer}} function builds upon code developed by Hruska et al. (2022) \doi{10.17605/OSF.IO/M2SAV} by fictionalizing, adding the percent of households earning <$30,000 per year to the \emph{NDI} computation, and providing the option for computing the ACS-5 2006-2010 \emph{NDI} values. There is no code companion to compute \emph{NDI} included in Andrews et al. (2020) \doi{10.1080/17445647.2020.1750066} or Slotman et al. (2022) \doi{10.1016/j.dib.2022.108002}, but the package author worked directly with the Slotman et al. (2022) \doi{10.1016/j.dib.2022.108002} authors to replicate their SAS code in \strong{R}. The indices of racial or ethnic residential segregation rely heavily on the \code{\link[sf]{sf-package}} and \code{\link[tigris]{tigris-package}} packages to assign the smaller geographical units within larger geographical units and, occasionally, perform geospatial projection for distance-based metrics. The computation of \emph{RI} and \emph{EI} also relies on the \code{\link[Matrix]{sparseMatrix}} function to compute the geospatial adjacency matrix between census geographies. Internal function to calculate \emph{AI} using the Hölder mean is based on \code{\link[DescTools]{Atkinson}} function. #' #' @author Ian D. Buller\cr \emph{DLH, LLC (formerly DLH Corporation and Social & Scientific Systems, Inc.), Bethesda, Maryland, USA (current); Occupational and Environmental Epidemiology Branch, Division of Cancer Epidemiology and Genetics, National Cancer Institute, National Institutes of Health, Rockville, Maryland, USA (original).} \cr #' #' Maintainer: I.D.B. \email{ian.buller@@alumni.emory.edu} #' #' @keywords internal -'_PACKAGE' +"_PACKAGE" #' @import dplyr #' @importFrom car logit diff --git a/R/powell_wiley.R b/R/powell_wiley.R index a694a26..5dc5769 100644 --- a/R/powell_wiley.R +++ b/R/powell_wiley.R @@ -31,7 +31,7 @@ #' #' Use the internal \code{state} and \code{county} arguments within the \code{\link[tidycensus]{get_acs}} function to specify the referent for standardizing the \emph{NDI} (Powell-Wiley) values. For example, if all U.S. states are specified for the \code{state} argument, then the output would be a U.S.-standardized index. Please note: the \emph{NDI} (Powell-Wiley) values will not exactly match (but will highly correlate with) those found in Andrews et al. (2020) \doi{10.1080/17445647.2020.1750066} and Slotman et al. (2022) \doi{10.1016/j.dib.2022.108002} because the two studies used a different statistical platform (i.e., SPSS and SAS, respectively) that intrinsically calculate the principal component analysis differently from R. #' -#' The categorical \emph{NDI} (Powell-Wiley) values are population-weighted quintiles of the continuous \emph{NDI} (Powell-Wiley) values. NOTE: As of version 0.1.6, population-weighted quintiles are computed using a weighted quantile function \code{\link[Hmisc]{wtd.quantile}} where values are calculated NDI and weights are Total Population instead of previously using \code{\link[stats]{quantile}} of the product of the calculated NDI and natural logarithm transformed total population. +#' The categorical \emph{NDI} (Powell-Wiley) values are population-weighted quintiles of the continuous \emph{NDI} (Powell-Wiley) values. NOTE: As of version 0.2.0, population-weighted quintiles are computed using a weighted quantile function \code{\link[Hmisc]{wtd.quantile}} where values are calculated NDI and weights are Total Population instead of previously using \code{\link[stats]{quantile}} of the product of the calculated NDI and natural logarithm transformed total population. #' #' Check if the proportion of variance explained by the first principal component is high (more than 0.5). #' diff --git a/README.md b/README.md index 0aec613..6884493 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ [![CRAN RStudio mirror downloads monthly](https://cranlogs.r-pkg.org/badges/ndi)](https://r-pkg.org:443/pkg/ndi) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/license/apache-2-0) ![GitHub last commit](https://img.shields.io/github/last-commit/idblr/ndi) -[![DOI](https://zenodo.org/badge/521439746.svg)](https://zenodo.org/badge/latestdoi/521439746) +[![](https://img.shields.io/badge/DOI-10.32614/CRAN.package.ndi-1f57b6?style=flat&link=https://doi.org/10.32614/CRAN.package.ndi)](https://doi.org/10.32614/CRAN.package.ndi) -**Date repository last updated**: 2025-05-30 +**Date repository last updated**: 2025-08-29 ### Overview diff --git a/cran-comments.md b/cran-comments.md index edb2f0d..388ba35 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,6 +1,8 @@ ## This is the seventh resubmission * Actions taken since previous submission: + +#### New Functions * 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_cuzzort()` function to compute the aspatial racial or ethnic Absolute Centralization (*ACE*) based on Duncan, Cuzzort, & Duncan (1961; LC:60007089) and [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281) @@ -14,20 +16,28 @@ * Added `morgan_massey()` function to compute the aspatial racial or ethnic Distance-Decay Isolation Index (_DPxx\*_) based on [Morgan (1983)](https://www.jstor.org/stable/20001935) and [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281) * Added `theil()` function the aspatial racial or ethnic Entropy (*H*) based on Theil (1972; ISBN:978-0-444-10378-9) and [Theil & Finizza (1971)](https://doi.org/110.1080/0022250X.1971.9989795) * 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) + +#### 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()`, `denton_cuzzort()`, `duncan()`, `duncan_cuzzort()`, `duncan_duncan()`, `hoover()`, `james_taeuber()`, `lieberson()`, `massey()`, `massey_duncan()`, `morgan_denton()`, `morgan_massey()`, `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 * The `gini()` function now computes the aspatial racial or ethnic Gini Index (*G*) based on [Gini (1921)](https://doi.org/10.2307/2223319) as the main outcome. Arguments `geo_large`, `geo_small`, `subgroup`, and `omit_NAs` were added and argument `geo` was deprecated. The `gini()` function still retrieves the original output of the aspatial income Gini Index (*G*) at each smaller geography and is moved from the `g` output to `g_data` output. * Specifying census block groups in `geo` or `geo_small` arguments is now `'block group'` or `'cbg'` to match internal `get_acs()` function from the [tidycensus](https://CRAN.R-project.org/package=tidycensus) package - * Fixed NOTE in CRAN checks to provide package anchors for Rd \link{} targets not in the package itself and the base packages within 'ndi-package.Rd' + +#### Bug Fixes + * Fixed NOTE in CRAN checks to provide package anchors for Rd `\link{}` targets not in the package itself and the base packages within 'ndi-package.Rd' * Updated population-weighted quantile method from `stats::quantile` to `Hmisc::wtd.quantile` in `powell_wiley()` * `bell()` function computes the Interaction Index (Bell) not the Isolation Index as previously documented. Updated documentation throughout. * Fixed bug in `bell()`, `bemanian_beyer()`, `duncan()`, `sudano()`, and `white()` functions when a smaller geography contains n=0 total population, will assign a value of zero (0) in the internal calculation instead of NA * Fixed bug in `atkinson()` function to properly compute the income Atkinson Index * Renamed *AI* as *A*, *DI* as *D*, *Gini* as *G*, and *II* as _xPy\*_ to align with the definitions from [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281). The output for `atkinson()` now produces `a` instead of `ai`. The output for `duncan()` now produces `d` instead of `ai`. The output for `gini()` now produces `g` instead of `gini`. The output for `bell()` now produces `xPy_star` instead of `II`. The internal functions `ai_fun()`, `di_fun()` and `ii_fun()` were renamed `a_fun()`, `ddd_fun()` and `xpy_star_fun()`, respectively. * Output of racial or ethnic residential segregation indices is now rounded to four significant digits + +#### New Dependencies * `Hmisc`, `tigris`, and `units` are now Imports + +#### Updated Documentation * Reformatted functions for consistent internal structure * 'package.R' deprecated. Replaced with 'ndi-package.R' and reordered the contents * Consolidated DESCRIPTION @@ -53,19 +63,25 @@ * * * +* The win-builder oldrelease throws a NOTE that "Author field differs from that derived from Authors@R". The behavior is OK because ORCID has different formatting but same information * Some tests and examples for `anthopolos()`, `atkinson()`, `bell()`, `bemanian_beyer()`, `bravo()`, `denton()`, `denton_cuzzort()`, `duncan()`, `duncan_cuzzort()`, `duncan_duncan()`, `gini()`, `hoover()`, `james_taeuber()`, `krieger()`, `lieberson()`, `massey()`, `massey_duncan()`, `messer()`, `powell_wiley()`, `sudano()`, `theil()`, `white()`, and `white_blau()` functions require a Census API key so they are skipped if NULL or not run ## Test environments -* local Windows install, R 4.4.1 +* local Windows install, R 4.5.1 * win-builder, (devel, release, oldrelease) -* Rhub - * Fedora Linux, R-devel, clang, gfortran - * Ubuntu Linux 20.04.1 LTS, R-release, GCC - * Windows Server 2022, R-devel, 64 bit - * Windows Server 2008 R2 SP1, R-release, 32⁄64 bit - * Oracle Solaris 10, x86, 32 bit, R-release - * macOS 10.13.6 High Sierra, R-release, CRAN's setup +* R-CMD-check on GitHub + * macos-latest (release) + * windows-latest (release) + * ubuntu-latest (devel) + * ubuntu-latest (release) + * ubuntu-latest (oldrel-1) +* Rhub v2 + * macos-15 on GitHub, ASAN + UBSAN on macOS (`m1-san`) + * macos-13 on GitHub(`macos`) + * Fedora Linux 40 (Container Image) (`gcc-asan`) + * Ubuntu 22.04.5 LTS (`ubuntu-clang`) + * Ubuntu 22.04.5 LTS (`ubuntu-gcc12`) ## R CMD check results 0 errors | 0 warnings | 0 notes diff --git a/inst/CITATION b/inst/CITATION index 76d5dc1..e2c9789 100755 --- a/inst/CITATION +++ b/inst/CITATION @@ -3,7 +3,7 @@ bibentry(bibtype = 'manual', author = as.person('Ian D. Buller'), publisher = 'The Comprehensive R Archive Network', year = '2025', - number = '0.1.6.9016.', + number = '0.2.0.', doi = '10.32614/CRAN.package.ndi', url = 'https://cran.r-project.org/package=ndi', @@ -11,7 +11,7 @@ bibentry(bibtype = 'manual', paste('Ian D. Buller (2025)', 'ndi: Neighborhood Deprivation Indices.', 'The Comprehensive R Archive Network.', - 'v0.1.6.9015.', + 'v0.2.0.', 'DOI:10.32614/CRAN.package.ndi', 'Accessed by: https://cran.r-project.org/package=ndi'), diff --git a/man/ndi-package.Rd b/man/ndi-package.Rd index db3d027..1620169 100644 --- a/man/ndi-package.Rd +++ b/man/ndi-package.Rd @@ -88,7 +88,7 @@ Key content of the 'ndi' package include:\cr \code{\link{DCtracts2020}} A sample dataset containing information about U.S. Census American Community Survey 5-year estimate data for the District of Columbia census tracts (2020). The data are obtained from the \code{\link[tidycensus]{get_acs}} function and formatted for the \code{\link{messer}} and \code{\link{powell_wiley}} functions input. } \section{Dependencies}{ - The 'ndi' package relies heavily upon \code{\link[tidycensus]{tidycensus}} to retrieve data from the U.S. Census Bureau American Community Survey five-year estimates and the \code{\link[psych]{psych}} for computing the neighborhood deprivation indices. The \code{\link{messer}} function builds upon code developed by Hruska et al. (2022) \doi{10.17605/OSF.IO/M2SAV} by fictionalizing, adding the percent of households earning <$30,000 per year to the \emph{NDI} computation, and providing the option for computing the ACS-5 2006-2010 \emph{NDI} values. There is no code companion to compute \emph{NDI} included in Andrews et al. (2020) \doi{10.1080/17445647.2020.1750066} or Slotman et al. (2022) \doi{10.1016/j.dib.2022.108002}, but the package author worked directly with the Slotman et al. (2022) \doi{10.1016/j.dib.2022.108002} authors to replicate their SAS code in \strong{R}. The indices of racial or ethnic residential segregation rely heavily on the \code{\link[sf]{sf}} and \code{\link[tigris]{tigris}} packages to assign the smaller geographical units within larger geographical units and, occasionally, perform geospatial projection for distance-based metrics. The computation of \emph{RI} and \emph{EI} also relies on the \code{\link[Matrix]{Matrix}} package to compute the geospatial adjacency matrix between census geographies. Internal function to calculate \emph{AI} using the Hölder mean is based on \code{\link[DescTools]{Atkinson}} function. + The 'ndi' package relies heavily upon \code{\link[tidycensus]{tidycensus-package}} to retrieve data from the U.S. Census Bureau American Community Survey five-year estimates and the \code{\link[psych]{psych-package}} for computing the neighborhood deprivation indices. The \code{\link{messer}} function builds upon code developed by Hruska et al. (2022) \doi{10.17605/OSF.IO/M2SAV} by fictionalizing, adding the percent of households earning <$30,000 per year to the \emph{NDI} computation, and providing the option for computing the ACS-5 2006-2010 \emph{NDI} values. There is no code companion to compute \emph{NDI} included in Andrews et al. (2020) \doi{10.1080/17445647.2020.1750066} or Slotman et al. (2022) \doi{10.1016/j.dib.2022.108002}, but the package author worked directly with the Slotman et al. (2022) \doi{10.1016/j.dib.2022.108002} authors to replicate their SAS code in \strong{R}. The indices of racial or ethnic residential segregation rely heavily on the \code{\link[sf]{sf-package}} and \code{\link[tigris]{tigris-package}} packages to assign the smaller geographical units within larger geographical units and, occasionally, perform geospatial projection for distance-based metrics. The computation of \emph{RI} and \emph{EI} also relies on the \code{\link[Matrix]{sparseMatrix}} function to compute the geospatial adjacency matrix between census geographies. Internal function to calculate \emph{AI} using the Hölder mean is based on \code{\link[DescTools]{Atkinson}} function. } \seealso{ diff --git a/man/powell_wiley.Rd b/man/powell_wiley.Rd index 01ac87d..55eaee7 100644 --- a/man/powell_wiley.Rd +++ b/man/powell_wiley.Rd @@ -64,7 +64,7 @@ The function uses the \code{\link[tidycensus]{get_acs}} function to obtain U.S. Use the internal \code{state} and \code{county} arguments within the \code{\link[tidycensus]{get_acs}} function to specify the referent for standardizing the \emph{NDI} (Powell-Wiley) values. For example, if all U.S. states are specified for the \code{state} argument, then the output would be a U.S.-standardized index. Please note: the \emph{NDI} (Powell-Wiley) values will not exactly match (but will highly correlate with) those found in Andrews et al. (2020) \doi{10.1080/17445647.2020.1750066} and Slotman et al. (2022) \doi{10.1016/j.dib.2022.108002} because the two studies used a different statistical platform (i.e., SPSS and SAS, respectively) that intrinsically calculate the principal component analysis differently from R. -The categorical \emph{NDI} (Powell-Wiley) values are population-weighted quintiles of the continuous \emph{NDI} (Powell-Wiley) values. NOTE: As of version 0.1.6, population-weighted quintiles are computed using a weighted quantile function \code{\link[Hmisc]{wtd.quantile}} where values are calculated NDI and weights are Total Population instead of previously using \code{\link[stats]{quantile}} of the product of the calculated NDI and natural logarithm transformed total population. +The categorical \emph{NDI} (Powell-Wiley) values are population-weighted quintiles of the continuous \emph{NDI} (Powell-Wiley) values. NOTE: As of version 0.2.0, population-weighted quintiles are computed using a weighted quantile function \code{\link[Hmisc]{wtd.quantile}} where values are calculated NDI and weights are Total Population instead of previously using \code{\link[stats]{quantile}} of the product of the calculated NDI and natural logarithm transformed total population. Check if the proportion of variance explained by the first principal component is high (more than 0.5). diff --git a/vignettes/ndi1.Rmd b/vignettes/ndi1.Rmd index 7a04c8d..ee6264a 100644 --- a/vignettes/ndi1.Rmd +++ b/vignettes/ndi1.Rmd @@ -70,7 +70,7 @@ A third output from the `messer()` function is a tibble containing a breakdown o messer2010GA$missing ``` -We can visualize the *NDI* (Messer) values geographically by linking them to spatial information from the [*tigris*]([*tidycensus*](https://CRAN.R-project.org/package=tigris) package and plotting with the [*ggplot2*]([*tidycensus*](https://CRAN.R-project.org/package=ggplot2) package suite. +We can visualize the *NDI* (Messer) values geographically by linking them to spatial information from the [*tigris*](https://CRAN.R-project.org/package=tigris) package and plotting with the [*ggplot2*](https://CRAN.R-project.org/package=ggplot2) package suite. ```{r messer_prep, results = 'hide'} # Obtain the 2010 counties from the 'tigris' package @@ -102,7 +102,7 @@ ggplot() + data = county2010GA, fill = 'transparent', color = 'white', - size = 0.2 + size = 0.10 ) + theme_minimal() + scale_fill_viridis_c() + @@ -135,7 +135,7 @@ ggplot() + data = county2010GA, fill = 'transparent', color = 'white', - size = 0.2 + size = 0.10 ) + theme_minimal() + scale_fill_viridis_d(guide = guide_legend(reverse = TRUE), na.value = 'grey80') + @@ -163,7 +163,7 @@ ggplot() + geom_sf( data = GA2010messer_county, aes(fill = NDI), - size = 0.20, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -190,7 +190,7 @@ ggplot() + geom_sf( data = GA2010messer_county, aes(fill = NDIQuartNA), - size = 0.20, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -256,7 +256,7 @@ A fourth output from the `powell_wiley()` function is a character string or nume powell_wiley2020DMVW$cronbach ``` -We can visualize the *NDI* (Powell-Wiley) values geographically by linking them to spatial information from the [*tigris*]([*tidycensus*](https://CRAN.R-project.org/package=tigris) package and plotting with the [*ggplot2*]([*tidycensus*](https://CRAN.R-project.org/package=ggplot2) package suite. +We can visualize the *NDI* (Powell-Wiley) values geographically by linking them to spatial information from the [*tigris*](https://CRAN.R-project.org/package=tigris) package and plotting with the [*ggplot2*](https://CRAN.R-project.org/package=ggplot2) package suite. ```{r powell_wiley_prep, results = 'hide'} # Obtain the 2020 counties from the 'tigris' package @@ -346,7 +346,7 @@ ggplot() + geom_sf( data = DMVW2020pw_county, aes(fill = NDI), - size = 0.20, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -373,7 +373,7 @@ ggplot() + geom_sf( data = DMVW2020pw_county, aes(fill = NDIQuint), - size = 0.20, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -416,7 +416,7 @@ ggplot() + geom_sf( data = DC2020pw, aes(fill = NDI_nonimp), - size = 0.2, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -431,7 +431,7 @@ ggplot() + geom_sf( data = DC2020pw, aes(fill = NDI_imp), - size = 0.2, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -458,7 +458,7 @@ ggplot() + geom_sf( data = DC2020pw, aes(fill = NDIQuintNA_nonimp), - size = 0.2, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -484,7 +484,7 @@ ggplot() + geom_sf( data = DC2020pw, aes(fill = NDIQuintNA_imp), - size = 0.2, + size = 0.10, color = 'white' ) + theme_minimal() + diff --git a/vignettes/ndi1.html b/vignettes/ndi1.html index 231e72f..874413d 100644 --- a/vignettes/ndi1.html +++ b/vignettes/ndi1.html @@ -12,7 +12,7 @@ - + 1. Neighborhood Deprivation Indices @@ -340,7 +340,7 @@

1. Neighborhood Deprivation Indices

Ian D. Buller (GitHub: @idblr)

-

2024-08-29

+

2025-08-29

@@ -495,8 +495,8 @@

Compute NDI (Messer)

## 7 PUB 1969 14 0.71 % ## 8 U30 1969 14 0.71 %

We can visualize the NDI (Messer) values geographically by -linking them to spatial information from the [tigris](tidycensus -package and plotting with the [ggplot2](tidycensus +linking them to spatial information from the tigris +package and plotting with the ggplot2 package suite.

# Obtain the 2010 counties from the 'tigris' package
 county2010GA <- counties(state = 'GA', year = 2010, cb = TRUE)
@@ -524,7 +524,7 @@ 

Compute NDI (Messer)

data = county2010GA, fill = 'transparent', color = 'white', - size = 0.2 + size = 0.10 ) + theme_minimal() + scale_fill_viridis_c() + @@ -557,7 +557,7 @@

Compute NDI (Messer)

data = county2010GA, fill = 'transparent', color = 'white', - size = 0.2 + size = 0.10 ) + theme_minimal() + scale_fill_viridis_d(guide = guide_legend(reverse = TRUE), na.value = 'grey80') + @@ -566,7 +566,7 @@

Compute NDI (Messer)

'Neighborhood Deprivation Index (Messer) Quartiles', subtitle = 'GA census tracts as the referent' )
-

+

The results above are at the tract level. The NDI (Messer) values can also be calculated at the county level.

messer2010GA_county <- messer(geo = 'county', state = 'GA', year = 2010)
@@ -580,7 +580,7 @@ 

Compute NDI (Messer)

geom_sf( data = GA2010messer_county, aes(fill = NDI), - size = 0.20, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -607,7 +607,7 @@

Compute NDI (Messer)

geom_sf( data = GA2010messer_county, aes(fill = NDIQuartNA), - size = 0.20, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -617,7 +617,7 @@

Compute NDI (Messer)

'Neighborhood Deprivation Index (Messer) Quartiles', subtitle = 'GA counties as the referent' )
-

+

Compute NDI (Powell-Wiley)

@@ -863,9 +863,8 @@

Compute NDI (Powell-Wiley)

powell_wiley2020DMVW$cronbach
## [1] 0.9321693

We can visualize the NDI (Powell-Wiley) values -geographically by linking them to spatial information from the -[tigris](tidycensus -package and plotting with the [ggplot2](tidycensus +geographically by linking them to spatial information from the tigris +package and plotting with the ggplot2 package suite.

# Obtain the 2020 counties from the 'tigris' package
 county2020 <- counties(cb = TRUE)
@@ -923,7 +922,7 @@ 

Compute NDI (Powell-Wiley)

'Neighborhood Deprivation Index (Powell-Wiley) Population-weighted Quintiles', subtitle = 'DC, MD, VA, and WV tracts as the referent' )
-

+

Like the NDI (Messer), we also compute county-level NDI (Powell-Wiley).

# Obtain the 2020 counties from the 'tigris' package
@@ -946,7 +945,7 @@ 

Compute NDI (Powell-Wiley)

geom_sf( data = DMVW2020pw_county, aes(fill = NDI), - size = 0.20, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -973,7 +972,7 @@

Compute NDI (Powell-Wiley)

geom_sf( data = DMVW2020pw_county, aes(fill = NDIQuint), - size = 0.20, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -983,7 +982,7 @@

Compute NDI (Powell-Wiley)

'Neighborhood Deprivation Index (Powell-Wiley) Population-weighted Quintiles', subtitle = 'DC, MD, VA, and WV counties as the referent' )
-

+

Advanced Features

@@ -1018,7 +1017,7 @@

Imputing missing census variables

geom_sf( data = DC2020pw, aes(fill = NDI_nonimp), - size = 0.2, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -1033,7 +1032,7 @@

Imputing missing census variables

geom_sf( data = DC2020pw, aes(fill = NDI_imp), - size = 0.2, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -1060,7 +1059,7 @@

Imputing missing census variables

geom_sf( data = DC2020pw, aes(fill = NDIQuintNA_nonimp), - size = 0.2, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -1086,7 +1085,7 @@

Imputing missing census variables

geom_sf( data = DC2020pw, aes(fill = NDIQuintNA_imp), - size = 0.2, + size = 0.10, color = 'white' ) + theme_minimal() + @@ -1096,7 +1095,7 @@

Imputing missing census variables

'Neighborhood Deprivation Index (Powell-Wiley) Quintiles, Imputed', subtitle = 'DC census tracts as the referent' )
-

+

Assign the referent (U.S.-Standardized Metric)

@@ -1130,17 +1129,17 @@

Assign the referent (U.S.-Standardized Metric)

'Histogram of US-standardized NDI (Powell-Wiley) values (2013-2017)', subtitle = 'U.S. census tracts as the referent (including AK, HI, and DC)' )
-

+

The process to compute a US-standardized NDI (Powell-Wiley) -took about 4.5 minutes to run on a machine with the features listed at +took about 12.7 minutes to run on a machine with the features listed at the end of the vignette.

sessionInfo()
-
## R version 4.4.1 (2024-06-14 ucrt)
+
## R version 4.5.1 (2025-06-13 ucrt)
 ## Platform: x86_64-w64-mingw32/x64
-## Running under: Windows 10 x64 (build 19045)
+## Running under: Windows 11 x64 (build 26100)
 ## 
 ## Matrix products: default
-## 
+##   LAPACK version 3.12.1
 ## 
 ## locale:
 ## [1] LC_COLLATE=English_United States.utf8 
@@ -1156,28 +1155,31 @@ 

Assign the referent (U.S.-Standardized Metric)

## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: -## [1] tigris_2.1 tidycensus_1.6.5 sf_1.0-16 ndi_0.1.6.9007 -## [5] ggplot2_3.5.1 dplyr_1.1.4 knitr_1.48 +## [1] tigris_2.2.1 tidycensus_1.7.3 sf_1.0-21 ndi_0.2.0 +## [5] ggplot2_3.5.2 dplyr_1.1.4 knitr_1.50 ## ## loaded via a namespace (and not attached): -## [1] gtable_0.3.5 xfun_0.47 bslib_0.8.0 psych_2.4.6.26 -## [5] lattice_0.22-6 tzdb_0.4.0 Cairo_1.6-2 vctrs_0.6.5 -## [9] tools_4.4.1 generics_0.1.3 curl_5.2.2 parallel_4.4.1 -## [13] tibble_3.2.1 proxy_0.4-27 fansi_1.0.6 highr_0.11 -## [17] pkgconfig_2.0.3 Matrix_1.7-0 KernSmooth_2.23-24 uuid_1.2-1 -## [21] lifecycle_1.0.4 farver_2.1.2 compiler_4.4.1 stringr_1.5.1 -## [25] munsell_0.5.1 mnormt_2.1.1 carData_3.0-5 htmltools_0.5.8.1 -## [29] class_7.3-22 sass_0.4.9 yaml_2.3.10 pillar_1.9.0 -## [33] car_3.1-2 crayon_1.5.3 jquerylib_0.1.4 tidyr_1.3.1 -## [37] MASS_7.3-61 classInt_0.4-10 cachem_1.1.0 abind_1.4-5 -## [41] nlme_3.1-166 tidyselect_1.2.1 rvest_1.0.4 digest_0.6.36 -## [45] stringi_1.8.4 purrr_1.0.2 labeling_0.4.3 fastmap_1.2.0 -## [49] grid_4.4.1 colorspace_2.1-1 cli_3.6.3 magrittr_2.0.3 -## [53] utf8_1.2.4 e1071_1.7-14 readr_2.1.5 withr_3.0.1 -## [57] scales_1.3.0 rappdirs_0.3.3 rmarkdown_2.28 httr_1.4.7 -## [61] hms_1.1.3 evaluate_0.24.0 viridisLite_0.4.2 rlang_1.1.4 -## [65] Rcpp_1.0.13 glue_1.7.0 DBI_1.2.3 xml2_1.3.6 -## [69] rstudioapi_0.16.0 jsonlite_1.8.8 R6_2.5.1 units_0.8-5
+## [1] tidyselect_1.2.1 psych_2.5.6 viridisLite_0.4.2 farver_2.1.2 +## [5] fastmap_1.2.0 digest_0.6.37 rpart_4.1.24 lifecycle_1.0.4 +## [9] cluster_2.1.8.1 Cairo_1.6-2 magrittr_2.0.3 compiler_4.5.1 +## [13] rlang_1.1.6 Hmisc_5.2-3 sass_0.4.10 tools_4.5.1 +## [17] utf8_1.2.6 yaml_2.3.10 data.table_1.17.8 labeling_0.4.3 +## [21] htmlwidgets_1.6.4 classInt_0.4-11 mnormt_2.1.1 curl_6.4.0 +## [25] xml2_1.3.8 RColorBrewer_1.1-3 abind_1.4-8 KernSmooth_2.23-26 +## [29] withr_3.0.2 foreign_0.8-90 purrr_1.1.0 nnet_7.3-20 +## [33] grid_4.5.1 e1071_1.7-16 colorspace_2.1-1 scales_1.4.0 +## [37] MASS_7.3-65 cli_3.6.5 rmarkdown_2.29 crayon_1.5.3 +## [41] generics_0.1.4 rstudioapi_0.17.1 httr_1.4.7 tzdb_0.5.0 +## [45] DBI_1.2.3 cachem_1.1.0 proxy_0.4-27 stringr_1.5.1 +## [49] rvest_1.0.4 parallel_4.5.1 base64enc_0.1-3 vctrs_0.6.5 +## [53] Matrix_1.7-3 jsonlite_2.0.0 carData_3.0-5 car_3.1-3 +## [57] hms_1.1.3 Formula_1.2-5 htmlTable_2.4.3 jquerylib_0.1.4 +## [61] tidyr_1.3.1 units_0.8-7 glue_1.8.0 stringi_1.8.7 +## [65] gtable_0.3.6 tibble_3.3.0 pillar_1.11.0 rappdirs_0.3.3 +## [69] htmltools_0.5.8.1 R6_2.6.1 evaluate_1.0.5 lattice_0.22-7 +## [73] readr_2.1.5 backports_1.5.0 bslib_0.9.0 class_7.3-23 +## [77] Rcpp_1.1.0 uuid_1.2-1 gridExtra_2.3 nlme_3.1-168 +## [81] checkmate_2.3.2 xfun_0.52 pkgconfig_2.0.3
diff --git a/vignettes/ndi2.html b/vignettes/ndi2.html index 7e60f77..6c7905f 100644 --- a/vignettes/ndi2.html +++ b/vignettes/ndi2.html @@ -12,7 +12,7 @@ - + 2. Racial or Ethnic Residential Segregation Indices @@ -341,7 +341,7 @@

2. Racial or Ethnic Residential Segregation Indices

Ian D. Buller (GitHub: @idblr)

-

2025-05-30

+

2025-08-29

@@ -621,7 +621,7 @@

Compute Dissimilarity Index (D)

'Dissimilarity Index (James & Taeuber)\nCensus tracts within counties of Pennsylvania', subtitle = 'Black population' ) -

+

The racial or ethnic Gini Index (G)

@@ -673,7 +673,7 @@

The racial or ethnic Gini Index (G)

'Gini Index (Gini)\nCensus tracts within counties of Massachusetts', subtitle = 'Black population' )
-

+

Compute Entropy (H)

@@ -731,7 +731,7 @@

Compute Entropy (H)

'Entropy (Theil)\nCensus tracts within Metro Divisions of Pennsylvania', subtitle = 'Black population' )
-

+

Compute Atkinson Index (A)

@@ -802,7 +802,7 @@

Compute Atkinson Index (A)

'Atkinson Index (Atkinson)\nCensus block groups within counties of Kentucky', subtitle = expression(paste('Black non-Hispanic (', epsilon, ' = 0.67)')) )
-

+

Compute Dissimilarity Index (D)

@@ -858,7 +858,7 @@

Compute Dissimilarity Index (D)

'Dissimilarity Index (Duncan & Duncan)\nCensus tracts within counties of Pennsylvania', subtitle = 'Black non-Hispanic vs. white non-Hispanic' )
-

+

Compute Location Quotient (LQ)

@@ -912,7 +912,7 @@

Compute Location Quotient (LQ)

'Location Quotient (Sudano)\nCounties within state of Tennessee', subtitle = 'Black non-Hispanic' )
-

+

Compute Interaction Index (xPy*)

@@ -962,7 +962,7 @@

Compute Interaction Index (xPy*)

'Interaction Index (Bell)\nCensus tracts within counties of Ohio', subtitle = 'Black non-Hispanic vs. white non-Hispanic' )
-

+

Compute Isolation Index (xPx*)

@@ -1012,7 +1012,7 @@

Compute Isolation Index (xPx*)

'Isolation Index (Lieberson)\nCensus block groups within census tracts of Delaware', subtitle = 'Black non-Hispanic' )
-

+

Compute Correlation Ratio (V)

@@ -1063,7 +1063,7 @@

Compute Correlation Ratio (V)

'Correlation Ratio (White)\nCensus tracts within counties of South Carolina', subtitle = 'Black non-Hispanic' )
-

+

Compute Local Exposure and Isolation (LEx/Is)

@@ -1131,7 +1131,7 @@

Compute Local Exposure and Isolation (LEx/Is)

'Local Exposure and Isolation (Bemanian & Beyer)\nCounties within state of Mississippi', subtitle = 'Black non-Hispanic vs. white non-Hispanic' )
-

+

# Visualize the exponentiated LEx/Is values (2017-2021 5-year ACS) for Counties within state of Mississippi
 ggplot() +
   geom_sf(
@@ -1153,7 +1153,7 @@ 

Compute Local Exposure and Isolation (LEx/Is)

'Odds ratio of Local Exposure and Isolation (Bemanian & Beyer)\nCounties within state of Mississippi', subtitle = 'Black non-Hispanic vs. white non-Hispanic' )
-

+

Compute Racial Isolation Index (RI)

@@ -1207,7 +1207,7 @@

Compute Racial Isolation Index (RI)

'Racial Isolation Index (Anthopolos)\nCensus tracts of North Carolina', subtitle = 'Black Non-Hispanic populations (not corrected for edge effects)' )
-

+

The current version of the ndi package does not correct for edge effects (e.g., census geographies along the specified spatial extent border, coastline, or U.S.-Mexico / U.S.-Canada @@ -1260,7 +1260,7 @@

Compute Racial Isolation Index (RI)

'Racial Isolation Index (Anthopolos)\nCensus tracts of North Carolina', subtitle = 'Black Non-Hispanic populations (corrected for interstate edge effects)' ) -

+

Compute Delta (DEL)

@@ -1308,7 +1308,7 @@

Compute Delta (DEL)

'Delta (Hoover)\nCensus tracts within counties within Alabama', subtitle = 'Black Non-Hispanic population' )
-

+

Compute Relative Concentration (RCO)

@@ -1372,7 +1372,7 @@

Compute Relative Concentration (RCO)

'Relative Concentration (Massey & Duncan)\nCensus tracts within core-based statistical areas of Wisconsin', subtitle = 'Black non-Hispanic vs. white non-Hispanic' )
-

+

Compute Absolute Concentration (ACO)

@@ -1429,7 +1429,7 @@

Compute Absolute Concentration (ACO)

'Absolute Concentration (Massey & Duncan)\nCensus tracts within core-based statistical areas of Wisconsin', subtitle = 'Black population' )
-

+

Compute Absolute Centralization (ACE)

@@ -1501,7 +1501,7 @@

Compute Absolute Centralization (ACE)

'Absolute Centralization (Duncan & Cuzzort)\nCensus block groups within census-designated places of Connecticut', subtitle = 'Black population' )
-

+

Compute Relative Centralization (RCE)

@@ -1578,7 +1578,7 @@

Compute Relative Centralization (RCE)

'Relative Centralization (Duncan & Duncan)\nCensus block groups within census-designated places of Connecticut', subtitle = 'Black non-Hispanic vs. white non-Hispanic' )
-

+

Compute Absolute Clustering (ACL)

@@ -1639,7 +1639,7 @@

Compute Absolute Clustering (ACL)

'Absolute Clustering (Massey & Denton)\nCensus block groups within census tracts of Harris County, TX', subtitle = 'Black population' )
-

+

Compute an index of spatial proximity (SP)

@@ -1704,7 +1704,7 @@

Compute an index of spatial proximity (SP)

'An index of spatial proximity (White)\nCensus tracts within combined statistical areas of Georgia', subtitle = 'Black non-Hispanic vs. white non-Hispanic' )
-

+

Compute Relative Clustering (RCL)

@@ -1765,7 +1765,7 @@

Compute Relative Clustering (RCL)

'Relative Clustering (Massey & Denton)\nCensus block groups within census tracts of Harris County, TX', subtitle = 'Black non-Hispanic vs. white non-Hispanic' )
-

+

Compute Distance-Decay Isolation Index (DPxy*)

@@ -1819,7 +1819,7 @@

Compute Distance-Decay Isolation Index (DPxy*)

'Distance-Decay Interaction Index (Morgan)\nCensus tracts within core-based statistical areas of Louisiana', subtitle = 'Black non-Hispanic vs. white non-Hispanic' )
-

+

Compute Distance-Decay Isolation Index (DPxx*)

@@ -1872,14 +1872,14 @@

Compute Distance-Decay Isolation Index (DPxx*)

'Distance-Decay Isolation Index (Morgan)\nCensus tracts within core-based statistical areas of Louisiana', subtitle = 'Black population' )
-

+

sessionInfo()
-
## R version 4.4.1 (2024-06-14 ucrt)
+
## R version 4.5.1 (2025-06-13 ucrt)
 ## Platform: x86_64-w64-mingw32/x64
-## Running under: Windows 10 x64 (build 19045)
+## Running under: Windows 11 x64 (build 26100)
 ## 
 ## Matrix products: default
-## 
+##   LAPACK version 3.12.1
 ## 
 ## locale:
 ## [1] LC_COLLATE=English_United States.utf8 
@@ -1895,28 +1895,31 @@ 

Compute Distance-Decay Isolation Index (DPxx*)

## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: -## [1] tigris_2.2.1 tidycensus_1.7.1 sf_1.0-21 ndi_0.1.6.9015 -## [5] ggplot2_3.5.2 dplyr_1.1.4 knitr_1.48 +## [1] tigris_2.2.1 tidycensus_1.7.3 sf_1.0-21 ndi_0.2.0 +## [5] ggplot2_3.5.2 dplyr_1.1.4 knitr_1.50 ## ## loaded via a namespace (and not attached): -## [1] gtable_0.3.6 xfun_0.47 bslib_0.8.0 psych_2.5.3 -## [5] lattice_0.22-6 tzdb_0.5.0 Cairo_1.6-2 vctrs_0.6.5 -## [9] tools_4.4.1 generics_0.1.4 curl_6.2.3 parallel_4.4.1 -## [13] tibble_3.2.1 proxy_0.4-27 highr_0.11 pkgconfig_2.0.3 -## [17] Matrix_1.7-0 KernSmooth_2.23-24 RColorBrewer_1.1-3 uuid_1.2-1 -## [21] lifecycle_1.0.4 compiler_4.4.1 farver_2.1.2 stringr_1.5.1 -## [25] mnormt_2.1.1 carData_3.0-5 htmltools_0.5.8.1 class_7.3-22 -## [29] sass_0.4.9 yaml_2.3.10 Formula_1.2-5 pillar_1.10.2 -## [33] car_3.1-3 crayon_1.5.3 jquerylib_0.1.4 tidyr_1.3.1 -## [37] MASS_7.3-61 classInt_0.4-11 cachem_1.1.0 wk_0.9.4 -## [41] abind_1.4-8 nlme_3.1-166 tidyselect_1.2.1 rvest_1.0.4 -## [45] digest_0.6.36 stringi_1.8.7 purrr_1.0.4 labeling_0.4.3 -## [49] fastmap_1.2.0 grid_4.4.1 cli_3.6.5 magrittr_2.0.3 -## [53] e1071_1.7-16 readr_2.1.5 withr_3.0.2 scales_1.4.0 -## [57] rappdirs_0.3.3 rmarkdown_2.28 httr_1.4.7 hms_1.1.3 -## [61] evaluate_0.24.0 viridisLite_0.4.2 s2_1.1.9 rlang_1.1.6 -## [65] Rcpp_1.0.14 glue_1.8.0 DBI_1.2.3 xml2_1.3.8 -## [69] rstudioapi_0.16.0 jsonlite_2.0.0 R6_2.6.1 units_0.8-7
+## [1] tidyselect_1.2.1 psych_2.5.6 viridisLite_0.4.2 farver_2.1.2 +## [5] fastmap_1.2.0 digest_0.6.37 rpart_4.1.24 lifecycle_1.0.4 +## [9] cluster_2.1.8.1 Cairo_1.6-2 magrittr_2.0.3 compiler_4.5.1 +## [13] rlang_1.1.6 Hmisc_5.2-3 sass_0.4.10 tools_4.5.1 +## [17] yaml_2.3.10 data.table_1.17.8 labeling_0.4.3 htmlwidgets_1.6.4 +## [21] classInt_0.4-11 mnormt_2.1.1 curl_6.4.0 xml2_1.3.8 +## [25] RColorBrewer_1.1-3 abind_1.4-8 KernSmooth_2.23-26 withr_3.0.2 +## [29] foreign_0.8-90 purrr_1.1.0 nnet_7.3-20 grid_4.5.1 +## [33] e1071_1.7-16 colorspace_2.1-1 scales_1.4.0 MASS_7.3-65 +## [37] cli_3.6.5 rmarkdown_2.29 crayon_1.5.3 generics_0.1.4 +## [41] rstudioapi_0.17.1 httr_1.4.7 tzdb_0.5.0 DBI_1.2.3 +## [45] cachem_1.1.0 proxy_0.4-27 stringr_1.5.1 rvest_1.0.4 +## [49] parallel_4.5.1 s2_1.1.9 base64enc_0.1-3 vctrs_0.6.5 +## [53] Matrix_1.7-3 jsonlite_2.0.0 carData_3.0-5 car_3.1-3 +## [57] hms_1.1.3 Formula_1.2-5 htmlTable_2.4.3 jquerylib_0.1.4 +## [61] tidyr_1.3.1 units_0.8-7 glue_1.8.0 stringi_1.8.7 +## [65] gtable_0.3.6 tibble_3.3.0 pillar_1.11.0 rappdirs_0.3.3 +## [69] htmltools_0.5.8.1 R6_2.6.1 wk_0.9.4 evaluate_1.0.5 +## [73] lattice_0.22-7 readr_2.1.5 backports_1.5.0 bslib_0.9.0 +## [77] class_7.3-23 Rcpp_1.1.0 uuid_1.2-1 gridExtra_2.3 +## [81] nlme_3.1-168 checkmate_2.3.2 xfun_0.52 pkgconfig_2.0.3
diff --git a/vignettes/ndi3.html b/vignettes/ndi3.html index 805bf98..611a8c6 100644 --- a/vignettes/ndi3.html +++ b/vignettes/ndi3.html @@ -12,7 +12,7 @@ - + 3. Additional indices of socioeconomic disparity @@ -341,7 +341,7 @@

3. Additional indices of socioeconomic disparity

Ian D. Buller (GitHub: @idblr)

-

2024-08-30

+

2025-08-29

@@ -445,7 +445,7 @@

Compute income Atkinson Index (A)

'Atkinson Index (Atkinson)\nCensus block groups within counties of Kentucky', subtitle = expression(paste('Median Household Income (', epsilon, ' = 0.33)')) ) -

+

Compute Educational Isolation Index (EI)

@@ -537,7 +537,7 @@

Compute Educational Isolation Index (EI)

'Educational Isolation Index (Bravo)\nCensus tracts of Oklahoma', subtitle = 'Without a four-year college degree (not corrected for edge effects)' )
-

+

Can correct one source of edge effect in the same manner as shown for the RI metric in vignette 2. Racial or Ethnic Residential Segregation Indices

@@ -604,7 +604,7 @@

The income Gini Index (G)

'Gini Index (Gini)\nCensus tracts within counties of Massachusetts', subtitle = 'Median Household Income' ) -

+

Index of Concentration at the Extremes (ICE)

@@ -789,14 +789,14 @@

Index of Concentration at the Extremes (ICE)

'Index of Concentration at the Extremes (Krieger)\nIncome & race or ethnicity combined', subtitle = 'white non-Hispanic (WNH) in 80th inc pctl vs. WNH in 20th inc pctl' )
-

+

sessionInfo()
-
## R version 4.4.1 (2024-06-14 ucrt)
+
## R version 4.5.1 (2025-06-13 ucrt)
 ## Platform: x86_64-w64-mingw32/x64
-## Running under: Windows 10 x64 (build 19045)
+## Running under: Windows 11 x64 (build 26100)
 ## 
 ## Matrix products: default
-## 
+##   LAPACK version 3.12.1
 ## 
 ## locale:
 ## [1] LC_COLLATE=English_United States.utf8 
@@ -812,28 +812,31 @@ 

Index of Concentration at the Extremes (ICE)

## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: -## [1] tigris_2.1 tidycensus_1.6.5 sf_1.0-16 ndi_0.1.6.9008 -## [5] ggplot2_3.5.1 dplyr_1.1.4 knitr_1.48 +## [1] tigris_2.2.1 tidycensus_1.7.3 sf_1.0-21 ndi_0.2.0 +## [5] ggplot2_3.5.2 dplyr_1.1.4 knitr_1.50 ## ## loaded via a namespace (and not attached): -## [1] gtable_0.3.5 xfun_0.47 bslib_0.8.0 psych_2.4.6.26 -## [5] lattice_0.22-6 tzdb_0.4.0 Cairo_1.6-2 vctrs_0.6.5 -## [9] tools_4.4.1 generics_0.1.3 curl_5.2.2 parallel_4.4.1 -## [13] tibble_3.2.1 proxy_0.4-27 fansi_1.0.6 highr_0.11 -## [17] pkgconfig_2.0.3 Matrix_1.7-0 KernSmooth_2.23-24 uuid_1.2-1 -## [21] lifecycle_1.0.4 farver_2.1.2 compiler_4.4.1 stringr_1.5.1 -## [25] munsell_0.5.1 mnormt_2.1.1 carData_3.0-5 htmltools_0.5.8.1 -## [29] class_7.3-22 sass_0.4.9 yaml_2.3.10 pillar_1.9.0 -## [33] car_3.1-2 crayon_1.5.3 jquerylib_0.1.4 tidyr_1.3.1 -## [37] MASS_7.3-61 classInt_0.4-10 cachem_1.1.0 abind_1.4-5 -## [41] nlme_3.1-166 tidyselect_1.2.1 rvest_1.0.4 digest_0.6.36 -## [45] stringi_1.8.4 purrr_1.0.2 labeling_0.4.3 fastmap_1.2.0 -## [49] grid_4.4.1 colorspace_2.1-1 cli_3.6.3 magrittr_2.0.3 -## [53] utf8_1.2.4 e1071_1.7-14 readr_2.1.5 withr_3.0.1 -## [57] scales_1.3.0 rappdirs_0.3.3 rmarkdown_2.28 httr_1.4.7 -## [61] hms_1.1.3 evaluate_0.24.0 viridisLite_0.4.2 rlang_1.1.4 -## [65] Rcpp_1.0.13 glue_1.7.0 DBI_1.2.3 xml2_1.3.6 -## [69] rstudioapi_0.16.0 jsonlite_1.8.8 R6_2.5.1 units_0.8-5
+## [1] tidyselect_1.2.1 psych_2.5.6 viridisLite_0.4.2 farver_2.1.2 +## [5] fastmap_1.2.0 digest_0.6.37 rpart_4.1.24 lifecycle_1.0.4 +## [9] cluster_2.1.8.1 Cairo_1.6-2 magrittr_2.0.3 compiler_4.5.1 +## [13] rlang_1.1.6 Hmisc_5.2-3 sass_0.4.10 tools_4.5.1 +## [17] yaml_2.3.10 data.table_1.17.8 labeling_0.4.3 htmlwidgets_1.6.4 +## [21] classInt_0.4-11 mnormt_2.1.1 curl_6.4.0 xml2_1.3.8 +## [25] RColorBrewer_1.1-3 abind_1.4-8 KernSmooth_2.23-26 withr_3.0.2 +## [29] foreign_0.8-90 purrr_1.1.0 nnet_7.3-20 grid_4.5.1 +## [33] e1071_1.7-16 colorspace_2.1-1 scales_1.4.0 MASS_7.3-65 +## [37] cli_3.6.5 rmarkdown_2.29 crayon_1.5.3 generics_0.1.4 +## [41] rstudioapi_0.17.1 httr_1.4.7 tzdb_0.5.0 DBI_1.2.3 +## [45] cachem_1.1.0 proxy_0.4-27 stringr_1.5.1 rvest_1.0.4 +## [49] parallel_4.5.1 base64enc_0.1-3 vctrs_0.6.5 Matrix_1.7-3 +## [53] jsonlite_2.0.0 carData_3.0-5 car_3.1-3 hms_1.1.3 +## [57] Formula_1.2-5 htmlTable_2.4.3 jquerylib_0.1.4 tidyr_1.3.1 +## [61] units_0.8-7 glue_1.8.0 stringi_1.8.7 gtable_0.3.6 +## [65] tibble_3.3.0 pillar_1.11.0 rappdirs_0.3.3 htmltools_0.5.8.1 +## [69] R6_2.6.1 evaluate_1.0.5 lattice_0.22-7 readr_2.1.5 +## [73] backports_1.5.0 bslib_0.9.0 class_7.3-23 Rcpp_1.1.0 +## [77] uuid_1.2-1 gridExtra_2.3 nlme_3.1-168 checkmate_2.3.2 +## [81] xfun_0.52 pkgconfig_2.0.3
From ea5bba6d6851830ad58ad15e2f4d458bab8d276d Mon Sep 17 00:00:00 2001 From: Ian D Buller Date: Thu, 4 Sep 2025 15:07:17 -0400 Subject: [PATCH 5/5] Prepare for CRAN v0.2.1 release * :link: Fixed broken URLs in 'theil.Rd', 'ndi-package.Rd', 'ndi2.html', README, and NEWS --- DESCRIPTION | 4 +-- NEWS.md | 10 ++++++- R/ndi-package.R | 4 +-- R/theil.R | 2 +- README.md | 8 +++--- cran-comments.md | 65 +++------------------------------------------ inst/CITATION | 4 +-- man/ndi-package.Rd | 4 +-- man/theil.Rd | 2 +- vignettes/ndi2.Rmd | 4 +-- vignettes/ndi2.html | 16 +++++------ 11 files changed, 36 insertions(+), 87 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6f63a86..136754f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: ndi Title: Neighborhood Deprivation Indices -Version: 0.2.0 -Date: 2025-08-29 +Version: 0.2.1 +Date: 2025-09-04 Authors@R: c(person(given = "Ian D.", family = "Buller", diff --git a/NEWS.md b/NEWS.md index d71bc70..ee379ba 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,13 @@ # ndi (development version) +## ndi v0.2.1 + +### New Features +* None + +### Updates +* Fixed broken URLs in 'theil.Rd', 'ndi-package.Rd', 'ndi2.html', README, and NEWS + ## ndi v0.2.0 ### New Features @@ -9,7 +17,7 @@ * Added `hoover()` function to compute the aspatial racial or ethnic Delta (*DEL*) based on [Hoover (1941)](https://doi.org/10.1017/S0022050700052980) and Duncan, Cuzzort, & Duncan (1961; LC:60007089) * Added `james_taeuber()` function to compute the aspatial racial or ethnic Dissimilarity Index (*D*) based on [James & Taeuber (1985)](https://doi.org/10.2307/270845) * Added `lieberson()` function to compute the aspatial racial or ethnic Isolation Index (_xPx\*_) based on Lieberson (1981; ISBN-13:978-1-032-53884-6) and and [Bell (1954)](https://doi.org/10.2307/2574118) -* Added `theil()` function the aspatial racial or ethnic Entropy (*H*) based on Theil (1972; ISBN:978-0-444-10378-9) and [Theil & Finizza (1971)](https://doi.org/110.1080/0022250X.1971.9989795) +* Added `theil()` function the aspatial racial or ethnic Entropy (*H*) based on Theil (1972; ISBN:978-0-444-10378-9) and [Theil & Finizza (1971)](https://doi.org/10.1080/0022250X.1971.9989795) * 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) diff --git a/R/ndi-package.R b/R/ndi-package.R index 9c24c76..4af31a0 100644 --- a/R/ndi-package.R +++ b/R/ndi-package.R @@ -26,7 +26,7 @@ #' #' \code{\link{sudano}} Computes the aspatial Location Quotient (\emph{LQ}) based on Merton (1939) \doi{10.2307/2084686} and Sudano et al. (2013) \doi{10.1016/j.healthplace.2012.09.015}. #' -#' \code{\link{theil}} Computes the aspatial Entropy (\emph{H}) based on Theil (1972; ISBN-13:978-0-444-10378-9) and Theil & Finizza (1971) \doi{110.1080/0022250X.1971.9989795}. +#' \code{\link{theil}} Computes the aspatial Entropy (\emph{H}) based on Theil (1972; ISBN-13:978-0-444-10378-9) and Theil & Finizza (1971) \doi{10.1080/0022250X.1971.9989795}. #' #' \emph{Indices of Racial or Ethnic Residential Exposure} #' @@ -64,7 +64,7 @@ #' #' \code{\link{morgan_massey}} Computes the aspatial Distance-Decay Isolation Index (\emph{DPxx\*}) based on Morgan (1986) \url{https://www.jstor.org/stable/20001935} and Massey & Denton (1988) \doi{10.1093/sf/67.2.281}. #' -#' \code{\link{white_blau}} Computes an index of spatial proximity (\emph{SP}) based on White (1986) \doi{10.2307/3644339} \url{} and Blau (1977; ISBN-13:978-0-029-03660-0). +#' \code{\link{white_blau}} Computes an index of spatial proximity (\emph{SP}) based on White (1986) \doi{10.2307/3644339} and Blau (1977; ISBN-13:978-0-029-03660-0). #' #' \strong{Additional Indices of Socioeconomic Disparity} #' diff --git a/R/theil.R b/R/theil.R index 9c319fb..21c3ec0 100644 --- a/R/theil.R +++ b/R/theil.R @@ -10,7 +10,7 @@ #' @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 aspatial Entropy (\emph{H}) of selected racial or ethnic subgroups and U.S. geographies for a specified geographical extent (e.g., the entire U.S. or a single state) based on Theil (1972; ISBN-13:978-0-444-10378-9) and Theil & Finizza (1971) \doi{110.1080/0022250X.1971.9989795}. This function provides the computation of \emph{H} for any of the U.S. Census Bureau race or ethnicity subgroups (including Hispanic and non-Hispanic individuals). +#' @details This function will compute the aspatial Entropy (\emph{H}) of selected racial or ethnic subgroups and U.S. geographies for a specified geographical extent (e.g., the entire U.S. or a single state) based on Theil (1972; ISBN-13:978-0-444-10378-9) and Theil & Finizza (1971) \doi{10.1080/0022250X.1971.9989795}. This function provides the computation of \emph{H} for any of the U.S. Census Bureau race or 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 aspatial computation. The yearly estimates are available for 2009 onward when ACS-5 data are available (2010 onward for \code{geo_large = 'cbsa'} and 2011 onward for \code{geo_large = 'place'}, \code{geo_large = 'csa'}, or \code{geo_large = 'metro'}) but may be available from other U.S. Census Bureau surveys. The twenty racial or ethnic subgroups (U.S. Census Bureau definitions) are: #' \itemize{ diff --git a/README.md b/README.md index 6884493..efca0c2 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ [![](https://img.shields.io/badge/DOI-10.32614/CRAN.package.ndi-1f57b6?style=flat&link=https://doi.org/10.32614/CRAN.package.ndi)](https://doi.org/10.32614/CRAN.package.ndi) -**Date repository last updated**: 2025-08-29 +**Date repository last updated**: 2025-09-04 ### Overview -Computes various geospatial indices of socioeconomic deprivation and disparity in the United States. Some indices are considered "spatial" because they consider the values of neighboring (i.e., adjacent) census geographies in their computation, while other indices are "aspatial" because they only consider the value within each census geography. Two types of aspatial neighborhood deprivation indices (NDI) are available: including: (1) based on [Messer et al. (2006)](https://doi.org/10.1007/s11524-006-9094-x) and (2) based on [Andrews et al. (2020)](https://doi.org/10.1080/17445647.2020.1750066) and [Slotman et al. (2022)](https://doi.org/10.1016/j.dib.2022.108002) who use variables chosen by [Roux and Mair (2010)](https://doi.org/:10.1111/j.1749-6632.2009.05333.x). Both are a decomposition of multiple demographic characteristics from the U.S. Census Bureau American Community Survey 5-year estimates (ACS-5; 2006-2010 onward). Using data from the ACS-5 (2005-2009 onward), the package can also compute indices of racial or ethnic residential segregation, including but limited to those discussed in [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281), and selected metrics of socioeconomic deprivation and disparity. +Computes various geospatial indices of socioeconomic deprivation and disparity in the United States. Some indices are considered "spatial" because they consider the values of neighboring (i.e., adjacent) census geographies in their computation, while other indices are "aspatial" because they only consider the value within each census geography. Two types of aspatial neighborhood deprivation indices (NDI) are available: including: (1) based on [Messer et al. (2006)](https://doi.org/10.1007/s11524-006-9094-x) and (2) based on [Andrews et al. (2020)](https://doi.org/10.1080/17445647.2020.1750066) and [Slotman et al. (2022)](https://doi.org/10.1016/j.dib.2022.108002) who use variables chosen by [Roux and Mair (2010)](https://doi.org/10.1111/j.1749-6632.2009.05333.x). Both are a decomposition of multiple demographic characteristics from the U.S. Census Bureau American Community Survey 5-year estimates (ACS-5; 2006-2010 onward). Using data from the ACS-5 (2005-2009 onward), the package can also compute indices of racial or ethnic residential segregation, including but limited to those discussed in [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281), and selected metrics of socioeconomic deprivation and disparity. ### Installation @@ -132,7 +132,7 @@ To install the development version from GitHub: theil -Compute the aspatial racial or ethnic Entropy (H) based on Theil (1972; ISBN-13:978-0-444-10378-9) and Theil & Finizza (1971) +Compute the aspatial racial or ethnic Entropy (H) based on Theil (1972; ISBN-13:978-0-444-10378-9) and Theil & Finizza (1971) white @@ -1782,7 +1782,7 @@ This package was originally developed while the author was a postdoctoral fellow ### Acknowledgments -The [`messer()`](R/messer.R) function functionalizes the code found in [Hruska et al. (2022)](https://doi.org/10.1016/j.janxdis.2022.102529) available on an [OSF repository](https://doi.org/10.17605/OSF.IO/M2SAV), but with percent with income less than $30K added to the computation based on [Messer et al. (2006)](https://doi.org/10.1007/s11524-006-9094-x). The [`messer()`](R/messer.R) function also allows for the computation of *NDI* (Messer) for each year between 2010-2020 (when the U.S. census characteristics are available to date). There was no code companion to compute *NDI* (Powell-Wiley) included in [Andrews et al. (2020)](https://doi.org/10.1080/17445647.2020.1750066) or [Slotman et al. (2022)](https://doi.org/10.1016/j.dib.2022.108002) only a [description](https://www.gis.cancer.gov/research/NeighDeprvIndex_Methods.pdf), but the package author worked directly with the latter manuscript authors to replicate their [*SAS*](https://www.sas.com) code in [**R**](https://cran.r-project.org/) for the [`powell_wiley()`](R/powell_wiley.R) function. See the Accumulating Data to Optimally Predict Obesity Treatment [(ADOPT)](https://gis.cancer.gov/research/adopt.html) Core Measures Project for more details. Please note: the *NDI* (Powell-Wiley) values will not exactly match (but will highly correlate with) those found in [Andrews et al. (2020)](https://doi.org/10.1080/17445647.2020.1750066) and [Slotman et al. (2022)](https://doi.org/10.1016/j.dib.2022.108002) because the two studies used a different statistical platform (i.e., [*SPSS*](https://www.ibm.com/spss) and [*SAS*](https://www.sas.com), respectively) that intrinsically calculate the principal component analysis differently from [**R**](https://cran.r-project.org/). The internal function to calculate the Atkinson Index with the Hölder mean is based on the `Atkinson()` function in the [*DescTools*](https://cran.r-project.org/package=DescTools) package. +The [`messer()`](R/messer.R) function functionalizes the code found in [Hruska et al. (2022)](https://doi.org/10.1016/j.janxdis.2022.102529) available on an [OSF repository](https://doi.org/10.17605/OSF.IO/M2SAV), but with percent with income less than $30K added to the computation based on [Messer et al. (2006)](https://doi.org/10.1007/s11524-006-9094-x). The [`messer()`](R/messer.R) function also allows for the computation of *NDI* (Messer) for each year between 2010-2020 (when the U.S. census characteristics are available to date). There was no code companion to compute *NDI* (Powell-Wiley) included in [Andrews et al. (2020)](https://doi.org/10.1080/17445647.2020.1750066) or [Slotman et al. (2022)](https://doi.org/10.1016/j.dib.2022.108002) only a [description](https://www.gis.cancer.gov/research/NeighDeprvIndex_Methods.pdf), but the package author worked directly with the latter manuscript authors to replicate their [*SAS*](https://www.sas.com) code in [**R**](https://cran.r-project.org/) for the [`powell_wiley()`](R/powell_wiley.R) function. See the Accumulating Data to Optimally Predict Obesity Treatment [(ADOPT)](https://gis.cancer.gov/research/adopt.html) Core Measures Project for more details. Please note: the *NDI* (Powell-Wiley) values will not exactly match (but will highly correlate with) those found in [Andrews et al. (2020)](https://doi.org/10.1080/17445647.2020.1750066) and [Slotman et al. (2022)](https://doi.org/10.1016/j.dib.2022.108002) because the two studies used a different statistical platform (i.e., [*SPSS*](https://www.ibm.com/products/spss) and [*SAS*](https://www.sas.com), respectively) that intrinsically calculate the principal component analysis differently from [**R**](https://cran.r-project.org/). The internal function to calculate the Atkinson Index with the Hölder mean is based on the `Atkinson()` function in the [*DescTools*](https://cran.r-project.org/package=DescTools) package. When citing this package for publication, please follow: diff --git a/cran-comments.md b/cran-comments.md index 388ba35..5f2bd2a 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,68 +1,9 @@ -## This is the seventh resubmission +## This is the eighth resubmission * Actions taken since previous submission: + * Fixed broken URLs in 'theil.Rd', 'ndi-package.Rd', 'ndi2.html', README, and NEWS -#### New Functions - * 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_cuzzort()` function to compute the aspatial racial or ethnic Absolute Centralization (*ACE*) based on Duncan, Cuzzort, & Duncan (1961; LC:60007089) and [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281) - * 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 `hoover()` function to compute the aspatial racial or ethnic Delta (*DEL*) based on [Hoover (1941)](https://doi.org/10.1017/S0022050700052980) and Duncan, Cuzzort, & Duncan (1961; LC:60007089) - * Added `james_taeuber()` function to compute the aspatial racial or ethnic Dissimilarity Index (*D*) based on [James & Taeuber (1985)](https://doi.org/10.2307/270845) - * Added `lieberson()` function to compute the aspatial racial or ethnic Isolation Index (_xPx\*_) based on Lieberson (1981; ISBN-13:978-1-032-53884-6) and and [Bell (1954)](https://doi.org/10.2307/2574118) - * 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) - * Added `morgan_denton()` function to compute the aspatial racial or ethnic Distance-Decay Interaction Index (_DPxy\*_) based on [Morgan (1983)](https://www.jstor.org/stable/20001935) and [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281) - * Added `morgan_massey()` function to compute the aspatial racial or ethnic Distance-Decay Isolation Index (_DPxx\*_) based on [Morgan (1983)](https://www.jstor.org/stable/20001935) and [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281) - * Added `theil()` function the aspatial racial or ethnic Entropy (*H*) based on Theil (1972; ISBN:978-0-444-10378-9) and [Theil & Finizza (1971)](https://doi.org/110.1080/0022250X.1971.9989795) - * 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) - -#### 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()`, `denton_cuzzort()`, `duncan()`, `duncan_cuzzort()`, `duncan_duncan()`, `hoover()`, `james_taeuber()`, `lieberson()`, `massey()`, `massey_duncan()`, `morgan_denton()`, `morgan_massey()`, `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 - * The `gini()` function now computes the aspatial racial or ethnic Gini Index (*G*) based on [Gini (1921)](https://doi.org/10.2307/2223319) as the main outcome. Arguments `geo_large`, `geo_small`, `subgroup`, and `omit_NAs` were added and argument `geo` was deprecated. The `gini()` function still retrieves the original output of the aspatial income Gini Index (*G*) at each smaller geography and is moved from the `g` output to `g_data` output. - * Specifying census block groups in `geo` or `geo_small` arguments is now `'block group'` or `'cbg'` to match internal `get_acs()` function from the [tidycensus](https://CRAN.R-project.org/package=tidycensus) package - -#### Bug Fixes - * Fixed NOTE in CRAN checks to provide package anchors for Rd `\link{}` targets not in the package itself and the base packages within 'ndi-package.Rd' - * Updated population-weighted quantile method from `stats::quantile` to `Hmisc::wtd.quantile` in `powell_wiley()` - * `bell()` function computes the Interaction Index (Bell) not the Isolation Index as previously documented. Updated documentation throughout. - * Fixed bug in `bell()`, `bemanian_beyer()`, `duncan()`, `sudano()`, and `white()` functions when a smaller geography contains n=0 total population, will assign a value of zero (0) in the internal calculation instead of NA - * Fixed bug in `atkinson()` function to properly compute the income Atkinson Index - * Renamed *AI* as *A*, *DI* as *D*, *Gini* as *G*, and *II* as _xPy\*_ to align with the definitions from [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281). The output for `atkinson()` now produces `a` instead of `ai`. The output for `duncan()` now produces `d` instead of `ai`. The output for `gini()` now produces `g` instead of `gini`. The output for `bell()` now produces `xPy_star` instead of `II`. The internal functions `ai_fun()`, `di_fun()` and `ii_fun()` were renamed `a_fun()`, `ddd_fun()` and `xpy_star_fun()`, respectively. - * Output of racial or ethnic residential segregation indices is now rounded to four significant digits - -#### New Dependencies - * `Hmisc`, `tigris`, and `units` are now Imports - -#### Updated Documentation - * Reformatted functions for consistent internal structure - * 'package.R' deprecated. Replaced with 'ndi-package.R' and reordered the contents - * Consolidated DESCRIPTION - * Re-formatted code and documentation throughout for consistent readability - * Renamed 'race/ethnicity' or 'racial/ethnic' to 'race or ethnicity' or 'racial or ethnic' throughout documentation to use more modern, inclusive, and appropriate language - * Updated documentation about value range of *V* (White) from `{0 to 1}` to `{-Inf to Inf}` - * Split up vignette into three separate vignettes: 'ndi1', 'ndi2', and 'ndi3' for the *NDI*, racial or ethnic residential segregation, and additional socioeconomic disparity indices, respectively - * Added examples for `atkinson()`, `duncan_cuzzort()`, `duncan_duncan()`, `gini()`, `hoover()`, `james_taeuber()`, `lieberson()`, `massey()`, `massey_duncan()`, `morgan_massey()`, `theil()`, and `white_blau()` functions in vignettes and README - * Added example for `holder` argument in `atkinson()` function in README - * Added internal and external references within each functions documentation - * Reordered and reformatted CITATION alphabetically by index abbreviation - * Reordered the README examples alphabetically - * Reordered the vignette examples to group the racial or ethnic residential segregation indices - * Updated examples in vignettes to showcase a larger variety of U.S. states - * Updated examples in functions to better describe the metrics - * Updated documentation formatting of metric names in all functions - -* Documentation for DESCRIPTION, README, NEWS, and vignette references the following DOIs, which throws a NOTE but are a valid URL: - * - * - * - * - * - * - * +* Words that throw a NOTE by DEBIAN and WINDOWS pre-tests as possibly misspelled but are OK: "geospatial" * The win-builder oldrelease throws a NOTE that "Author field differs from that derived from Authors@R". The behavior is OK because ORCID has different formatting but same information * Some tests and examples for `anthopolos()`, `atkinson()`, `bell()`, `bemanian_beyer()`, `bravo()`, `denton()`, `denton_cuzzort()`, `duncan()`, `duncan_cuzzort()`, `duncan_duncan()`, `gini()`, `hoover()`, `james_taeuber()`, `krieger()`, `lieberson()`, `massey()`, `massey_duncan()`, `messer()`, `powell_wiley()`, `sudano()`, `theil()`, `white()`, and `white_blau()` functions require a Census API key so they are skipped if NULL or not run diff --git a/inst/CITATION b/inst/CITATION index e2c9789..e0866b7 100755 --- a/inst/CITATION +++ b/inst/CITATION @@ -3,7 +3,7 @@ bibentry(bibtype = 'manual', author = as.person('Ian D. Buller'), publisher = 'The Comprehensive R Archive Network', year = '2025', - number = '0.2.0.', + number = '0.2.1.', doi = '10.32614/CRAN.package.ndi', url = 'https://cran.r-project.org/package=ndi', @@ -11,7 +11,7 @@ bibentry(bibtype = 'manual', paste('Ian D. Buller (2025)', 'ndi: Neighborhood Deprivation Indices.', 'The Comprehensive R Archive Network.', - 'v0.2.0.', + 'v0.2.1.', 'DOI:10.32614/CRAN.package.ndi', 'Accessed by: https://cran.r-project.org/package=ndi'), diff --git a/man/ndi-package.Rd b/man/ndi-package.Rd index 1620169..b5a5770 100644 --- a/man/ndi-package.Rd +++ b/man/ndi-package.Rd @@ -33,7 +33,7 @@ Key content of the 'ndi' package include:\cr \code{\link{sudano}} Computes the aspatial Location Quotient (\emph{LQ}) based on Merton (1939) \doi{10.2307/2084686} and Sudano et al. (2013) \doi{10.1016/j.healthplace.2012.09.015}. -\code{\link{theil}} Computes the aspatial Entropy (\emph{H}) based on Theil (1972; ISBN-13:978-0-444-10378-9) and Theil & Finizza (1971) \doi{110.1080/0022250X.1971.9989795}. +\code{\link{theil}} Computes the aspatial Entropy (\emph{H}) based on Theil (1972; ISBN-13:978-0-444-10378-9) and Theil & Finizza (1971) \doi{10.1080/0022250X.1971.9989795}. \emph{Indices of Racial or Ethnic Residential Exposure} @@ -71,7 +71,7 @@ Key content of the 'ndi' package include:\cr \code{\link{morgan_massey}} Computes the aspatial Distance-Decay Isolation Index (\emph{DPxx\*}) based on Morgan (1986) \url{https://www.jstor.org/stable/20001935} and Massey & Denton (1988) \doi{10.1093/sf/67.2.281}. -\code{\link{white_blau}} Computes an index of spatial proximity (\emph{SP}) based on White (1986) \doi{10.2307/3644339} \url{} and Blau (1977; ISBN-13:978-0-029-03660-0). +\code{\link{white_blau}} Computes an index of spatial proximity (\emph{SP}) based on White (1986) \doi{10.2307/3644339} and Blau (1977; ISBN-13:978-0-029-03660-0). \strong{Additional Indices of Socioeconomic Disparity} diff --git a/man/theil.Rd b/man/theil.Rd index a9e11df..c78bd9f 100644 --- a/man/theil.Rd +++ b/man/theil.Rd @@ -42,7 +42,7 @@ An object of class 'list'. This is a named list with the following components: Compute the aspatial Entropy (Theil) of selected racial or ethnic subgroup(s) and U.S. geographies } \details{ -This function will compute the aspatial Entropy (\emph{H}) of selected racial or ethnic subgroups and U.S. geographies for a specified geographical extent (e.g., the entire U.S. or a single state) based on Theil (1972; ISBN-13:978-0-444-10378-9) and Theil & Finizza (1971) \doi{110.1080/0022250X.1971.9989795}. This function provides the computation of \emph{H} for any of the U.S. Census Bureau race or ethnicity subgroups (including Hispanic and non-Hispanic individuals). +This function will compute the aspatial Entropy (\emph{H}) of selected racial or ethnic subgroups and U.S. geographies for a specified geographical extent (e.g., the entire U.S. or a single state) based on Theil (1972; ISBN-13:978-0-444-10378-9) and Theil & Finizza (1971) \doi{10.1080/0022250X.1971.9989795}. This function provides the computation of \emph{H} for any of the U.S. Census Bureau race or 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 aspatial computation. The yearly estimates are available for 2009 onward when ACS-5 data are available (2010 onward for \code{geo_large = 'cbsa'} and 2011 onward for \code{geo_large = 'place'}, \code{geo_large = 'csa'}, or \code{geo_large = 'metro'}) but may be available from other U.S. Census Bureau surveys. The twenty racial or ethnic subgroups (U.S. Census Bureau definitions) are: \itemize{ diff --git a/vignettes/ndi2.Rmd b/vignettes/ndi2.Rmd index 9ff9f92..4802f5c 100644 --- a/vignettes/ndi2.Rmd +++ b/vignettes/ndi2.Rmd @@ -41,7 +41,7 @@ Since version v0.1.1, the [*ndi*](https://CRAN.R-project.org/package=ndi) packag * `james_taeuber()` function that computes the Dissimilarity Index (*D*) based on [James & Taeuber (1985)](https://doi.org/10.2307/270845) * `gini()` function that computes the Gini Index (*G*) based on [Gini (1921)](https://doi.org/10.2307/2223319) - * `theil()` function that computes Entropy (*H*) based on Theil (1972; ISBN:978-0-444-10378-9) and [Theil & Finizza (1971)](https://doi.org/110.1080/0022250X.1971.9989795) + * `theil()` function that computes Entropy (*H*) based on Theil (1972; ISBN:978-0-444-10378-9) and [Theil & Finizza (1971)](https://doi.org/10.1080/0022250X.1971.9989795) * `atkinson()` function that computes the Atkinson Index (*A*) based on [Atkinson (1970)](https://doi.org/10.1016/0022-0531(70)90039-6) * `duncan()` function that computes the Dissimilarity Index (*D*) based on [Duncan & Duncan (1955a)](https://doi.org/10.2307/2088328) * `sudano()` function that computes the Location Quotient (*LQ*) based on [Merton (1939)](https://doi.org/10.2307/2084686) and [Sudano et al. (2013)](https://doi.org/10.1016/j.healthplace.2012.09.015) @@ -848,7 +848,7 @@ ggplot() + Compute the racial or ethnic *ACE* values (2013-2017 5-year ACS) for census block groups within census-designated places of Connecticut. This metric is based on Duncan, Cuzzort, & Duncan (1961; LC:60007089) and [Massey & Denton (1988)](https://doi.org/10.1093/sf/67.2.281). *ACE* is a measure of the degree to which racial or ethnic populations within smaller geographical units are located near the center of a larger geographical unit. *ACE* is a measure of concentration of racial or ethnic populations within smaller geographical units that are located within larger geographical units. *ACE* can range from 0 to 1 and represents the relative amount of physical space occupied by a racial or ethnic subgroup in a larger geographical unit. A value of 1 indicates that a racial or ethnic subgroup has achieved the maximum spatial concentration possible (all racial or ethnic subgroup members live in the smallest of the smaller geographical units). A value of 0 indicates the maximum deconcentration possible (all racial or ethnic subgroup members live in the largest of the smaller geographical units). -Note: The original metric used the location of the central business district (CBD) to compute the metric, but the U.S. Census Bureau has not defined CBDs for U.S. cities since the [1982 Census of Retail Trade](http://www.census.gov/geo/www/cbd.html). Therefore, this function uses the the centroids of each larger geographical unit as the 'centre', but may not represent the current CBD. +Note: The original metric used the location of the central business district (CBD) to compute the metric, but the U.S. Census Bureau has not defined CBDs for U.S. cities since the [1982 Census of Retail Trade](https://www.census.gov/data/tables/1982/econ/arts/annual-report.html). Therefore, this function uses the the centroids of each larger geographical unit as the 'centre', but may not represent the current CBD. ```{r duncan_cuzzort_prep, results = 'hide'} duncan_cuzzort2017CT <- duncan_cuzzort( diff --git a/vignettes/ndi2.html b/vignettes/ndi2.html index 6c7905f..f8a063e 100644 --- a/vignettes/ndi2.html +++ b/vignettes/ndi2.html @@ -12,7 +12,7 @@ - + 2. Racial or Ethnic Residential Segregation Indices @@ -341,7 +341,7 @@

2. Racial or Ethnic Residential Segregation Indices

Ian D. Buller (GitHub: @idblr)

-

2025-08-29

+

2025-09-04

@@ -372,8 +372,8 @@

Racial or Ethnic Residential Segregation Indices

(G) based on Gini (1921)
  • theil() function that computes Entropy (H) -based on Theil (1972; ISBN:978-0-444-10378-9) and Theil & -Finizza (1971)
  • +based on Theil (1972; ISBN:978-0-444-10378-9) and Theil & Finizza +(1971)
  • atkinson() function that computes the Atkinson Index (A) based on Atkinson (1970)
  • @@ -1452,10 +1452,10 @@

    Compute Absolute Centralization (ACE)

    the smaller geographical units).

    Note: The original metric used the location of the central business district (CBD) to compute the metric, but the U.S. Census Bureau has not -defined CBDs for U.S. cities since the 1982 Census of Retail -Trade. Therefore, this function uses the the centroids of each -larger geographical unit as the ‘centre’, but may not represent the -current CBD.

    +defined CBDs for U.S. cities since the 1982 +Census of Retail Trade. Therefore, this function uses the the +centroids of each larger geographical unit as the ‘centre’, but may not +represent the current CBD.

    duncan_cuzzort2017CT <- duncan_cuzzort(
       geo_large = 'place',
       geo_small = 'cbg',