A common inquiry in demographic studies involves assessing segregation levels between racial groups. For example, how segregated is the Hispanic population? Traditionally, the dissimilarity index D assesses segregation between two groups. In other studies, authors used multiracial information theory index H to assess the segregation level between one racial group and the remaining groups (i.e., Elbers, 2022.

The example shows how NRGD2020 and the raceland package can be used to determine the level of segregation between a racial group and the remaining racial groups inhabiting the area.

1 Data

The inputs for calculating racial segregation metrics for a particular racial group (i.e., Hispanics/Latinos, or Blacks) are RL grid racial ID and RL grid population density from NRGD2020. This example uses two layers included in the Atlanta datasetAtlanta dataset can be downloaded from http://www.socscape.edu.pl/index.php?id=nrgd)

2 How segregated is the Hispanics/Latino population from the remaining groups in Atlanta, MSA?

library(terra)
library(raceland)

#set working directory to the folder containing data using function setwd("")
##setwd("")

#read RL grid racial ID to R using terra package
rl = rast("Atlanta_dataset/RL_grids/rl_msa.tif")
#read RL grid population density to R using terra package
rd = rast("Atlanta_dataset/RL_grids/rd_msa.tif")

######## CALCULATE SEGREGATION METRICS FOR HISPANICS/LATIONOS ########
#reclassify data to two categories - Hispanics and non-Hispanic population. 
# RL grid racial ID consists of 6 categories: 1 - Native Americans, 2 - Asians, 3 - Blacks, 4 - Hispanics, 5 - others, 6 - Whites)
# Assign 1 to HISPANIC sub-population and 0 to all other racial groups. 
rcl = cbind(c(1,2,3,4,5,6), c(0, 0, 0, 1, 0,0))
rl_hisp = classify(rl, rcl)

#calculate diversity and segregation metrics using raceland package 
metr = calculate_metrics(rl_hisp, rd, fun = "mean", threshold = 1)
#return metrics in a user-friendly format
Hispanics = c(MI = metr$mutinf, NMI = metr$mutinf/metr$ent)

3 How segregated is Black population from remaining groups in Atlanta, MSA?

######## CALCULATE SEGREGATION METRICS FOR BLACK ########
#reclassify data to two categories - Black and non-black population. 
# RL grid racial ID consists of 6 categories: 1 - Native Americans, 2 - Asians, 3 - Blacks, 4 - Hispanics, 5 - others, 6 - Whites)
# Assign 1 to Black sub-population and 0 to all other racial groups. 
rcl = cbind(c(1,2,3,4,5,6), c(0, 0, 1, 0, 0,0))
rl_black = classify(rl, rcl)

#calculate diversity and segregation metrics using raceland package 
metr = calculate_metrics(rl_black, rd, fun = "mean", threshold = 1)
#return segregation metrics in a user-friendly format
Black = c(MI = metr$mutinf, NMI = metr$mutinf/metr$ent)

4 Results

4.1 Visualizing Blacks population in the Atlanta, MSA

plot(rl_black, col = c("#ececec", "#6EBE44"), legend = FALSE, axes = FALSE, main = "BLACKS")

4.2 Visualizing Hispanics/Latino population in the Atlanta, MSA

plot(rl_hisp, col = c("#ececec", "#7E69AF"), legend = FALSE, axes = FALSE, main = "HISPANICS")

4.3 Segregation metrics by the racial group

The table shows:

  • a pairwise segregation of Blacks from Whites, Hispanics, Asians, and others.
  • a pairwise segregation of Hispanics from Whites, Blacks, Asians, and others.
library(kableExtra)
res = rbind(Black, Hispanics)
kable_classic(kbl(round(res, 4)), full_width = F)
MI NMI
Black 0.1322 0.1447
Hispanics 0.0220 0.0416