powell_wiley {ndi}R Documentation

Neighborhood Deprivation Index based on Andrews et al. (2020) and Slotman et al. (2022)

Description

Compute the aspatial Neighborhood Deprivation Index (Powell-Wiley).

Usage

powell_wiley(
  geo = "tract",
  year = 2020,
  imp = FALSE,
  quiet = FALSE,
  round_output = FALSE,
  df = NULL,
  ...
)

Arguments

geo

Character string specifying the geography of the data either census tracts geo = "tract" (the default) or counties geo = "county".

year

Numeric. The year to compute the estimate. The default is 2020, and the years 2010 onward are currently available.

imp

Logical. If TRUE, will impute missing census characteristics within the internal principal using median values of variables. If FALSE (the default), will not impute.

quiet

Logical. If TRUE, will display messages about potential missing census information, standardized Cronbach's alpha, and proportion of variance explained by principal component analysis. The default is FALSE.

round_output

Logical. If TRUE, will round the output of raw census and NDI values from the get_acs at one and four significant digits, respectively. The default is FALSE.

df

Optional. Pass a pre-formatted 'dataframe' or 'tibble' with the desired variables through the function. Bypasses the data obtained by get_acs. The default is NULL. See Details below.

...

Arguments passed to get_acs to select state, county, and other arguments for census characteristics

Details

This function will compute the aspatial Neighborhood Deprivation Index (NDI) of U.S. census tracts or counties for a specified geographical referent (e.g., US-standardized) based on Andrews et al. (2020) doi:10.1080/17445647.2020.1750066 and Slotman et al. (2022) doi:10.1016/j.dib.2022.108002.

The function uses the get_acs function to obtain U.S. Census Bureau 5-year American Community Survey characteristics used for computation involving a factor analysis with the principal function. The yearly estimates are available in 2010 and after when all census characteristics became available. The thirteen characteristics chosen by Roux and Mair (2010) doi:10.1111/j.1749-6632.2009.05333.x are:

Use the internal state and county arguments within the get_acs function to specify the referent for standardizing the NDI (Powell-Wiley) values. For example, if all U.S. states are specified for the state argument, then the output would be a U.S.-standardized index. Please note: the 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 NDI (Powell-Wiley) values are population-weighted quintiles of the continuous NDI (Powell-Wiley) values.

Check if the proportion of variance explained by the first principal component is high (more than 0.5).

Users can bypass get_acs by specifying a pre-formatted data frame or tibble using the df argument. This function will compute an index using the first component of a principal component analysis (PCA) with a Promax (oblique) rotation and a minimum Eigenvalue of 1, omitting variables with absolute loading score < 0.4. The recommended structure of the data frame or tibble is an ID (e.g., GEOID) in the first feature (column), an estimate of the total population in the second feature (column), followed by the variables of interest (in any order) and no additional information (e.g., omit state or county names from the df argument input).

Value

An object of class 'list'. This is a named list with the following components:

ndi

An object of class 'tbl' for the GEOID, name, NDI continuous, NDI quintiles, and raw census values of specified census geographies.

pca

An object of class 'principal', returns the output of principal used to compute the NDI values.

missing

An object of class 'tbl' of the count and proportion of missingness for each census variable used to compute NDI.

cronbach

An object of class 'character' or 'numeric' for the results of the Cronbach's alpha calculation. If only one factor is computed, a message is returned. If more than one factor is computed, Cronbach's alpha is calculated and should check that it is >0.7 for respectable internal consistency between factors.

See Also

get_acs for additional arguments for geographic referent selection (i.e., state and county).

Examples


powell_wiley(df = DCtracts2020[ , -c(3:10)])

## Not run: 
# Wrapped in \dontrun{} because these examples require a Census API key.
  
  # Tract-level metric (2020)
  powell_wiley(geo = "tract", state = "GA", year = 2020)

  # Impute NDI for tracts (2020) with missing census information (median values)
  powell_wiley(state = "tract", "GA", year = 2020, imp = TRUE)
  
  # County-level metric (2020)
  powell_wiley(geo = "county", state = "GA", year = 2020)
  

## End(Not run)


[Package ndi version 0.1.5 Index]