messer | R Documentation |
Compute the aspatial Neighborhood Deprivation Index (Messer).
messer(
geo = "tract",
year = 2020,
imp = FALSE,
quiet = FALSE,
round_output = FALSE,
df = NULL,
...
)
geo |
Character string specifying the geography of the data either census tracts |
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 |
quiet |
Logical. If TRUE, will display messages about potential missing census information and the 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 |
df |
Optional. Pass a pre-formatted |
... |
Arguments passed to |
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 Messer et al. (2006) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11524-006-9094-x")}.
The function uses the get_acs
function to obtain U.S. Census Bureau 5-year American Community Survey characteristics used for computation involving a principal component analysis with the principal
function. The yearly estimates are available for 2010 and after when all census characteristics became available. The eight characteristics are:
OCC (C24030): percent males in management, science, and arts occupation
CWD (B25014): percent of crowded housing
POV (B17017): percent of households in poverty
FHH (B25115): percent of female headed households with dependents
PUB (B19058): percent of households on public assistance
U30 (B19001): percent of households earning <$30,000 per year
EDU (B06009): percent earning less than a high school education
EMP (B23025): percent unemployed (2011 onward)
EMP (B23001): percent unemployed (2010 only)
Use the internal state
and county
arguments within the get_acs
function to specify the referent for standardizing the NDI (Messer) values. For example, if all U.S. states are specified for the state
argument, then the output would be a U.S.-standardized index.
The continuous NDI (Messer) values are z-transformed, i.e., "standardized," and the categorical NDI (Messer) values are quartiles of the standardized continuous NDI (Messer) 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 Varimax rotation (the default for principal
) and only one factor (note: PCA set-up not unspecified in Messer et al. (2006)). The recommended structure of the data frame or tibble is an ID (e.g., GEOID) in the first 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).
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 (standardized), NDI (quartile), 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.
get_acs
for additional arguments for geographic referent selection (i.e., state
and county
).
messer(df = DCtracts2020[ , c(1, 3:10)])
## Not run:
# Wrapped in \dontrun{} because these examples require a Census API key.
# Tract-level metric (2020)
messer(geo = "tract", state = "GA", year = 2020)
# Impute NDI for tracts (2020) with missing census information (median values)
messer(state = "tract", "GA", year = 2020, imp = TRUE)
# County-level metric (2020)
messer(geo = "county", state = "GA", year = 2020)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.