Sungji Peter Shin
4.14.2019

Exploring Young-Age (18-24) Population within the Sate Prison (1991-2015)

This exploratory analysis will investigate if there is a variation in number of young adults in state prison by states and years. Dataset used was collected by the United States Department of Justice, Bureau of Justice Statistics, and maintained by Inter-University Consortium for Political and Social Research (ICPSR). This contains one record for each prisoner in custody on December 31 of each year. Total number of cases is 19,969,602 and number of variables is 16. Among them, 3,073,689 are classified as young adults whose age is between 18 and 24.

library(tidyverse)
library(data.table)
library(dplyr)
library(maps)
library(ggplot2)
library(mapproj)
library(gganimate)
library(gifski)
library(transformr)
prison <- as.data.frame(fread("C:/Users/jw/Desktop/ICPSR_36862/DS0004/36862-0004-Data.tsv"))
#selecting inmates whose age is between 18 and 24 on December 31 of the reporting year
young <- filter(prison, AGEYREND == 1)
head(young)
#recoding variables
young <- young %>% 
  mutate(state = as.character(STATE))
young <- young %>% 
  mutate(state = recode(state, '1' = 'alabama', '2' = 'alaska', '4' = 'arizona', '5' = 'arkansas', '6' = 'california', '8' = 'colorado', '9' = 'connecticut', '10' = 'delaware', '11' = 'DC', '12' = 'florida', '13' = 'georgia', '15' = 'hawaii', '16' = 'idaho', '17' = 'illinois', '18' = 'indiana', '19' = 'iowa', '20' = 'kansas', '21' = 'kentucky', '22' = 'louisiana', '23' = 'maine', '24' = 'maryland', '25' = 'massachusetts', '26' = 'michigan', '27' = 'minnesota', '28' = 'mississippi', '29' = 'missouri', '30' = 'montana', '31' = 'nebraska', '32' = 'nevada', '33' = 'new hamshire', '34' = 'new jersey', '35' = 'new mexico', '36' = 'new york', '37' = 'north carolina', '38' = 'north dakota', '39' = 'ohio', '40' = 'oklahoma', '41' = 'oregon', '42' = 'pennsylvania', '44' = 'rhode island', '45' = 'south carolina', '46' = 'south dakota', '47' = 'tennessee', '48' = 'texas', '49' = 'utah', '50' = 'vermont', '51' = 'virginia', '53' = 'washington', '54' = 'west virginia', '55' = 'wisconsin', '56' = 'wyominng'))

#state-level dataframe
state <- young %>% 
  group_by(state) %>% 
  count()

#grouping by years
year <- young %>% 
  group_by(RPTYEAR, state) %>% 
  count()

y2015 <- filter(prison, RPTYEAR == 2015) 
y2015 <- y2015 %>% 
  group_by(STATE) %>% 
  summarise(overall = n(), young_pop = sum(AGEYREND == 1)) %>% arrange(desc(overall))  
y2015 <- y2015 %>% 
  mutate(state = as.character(STATE))
y2015 <- y2015 %>% 
  mutate(state = recode(state, '1' = 'alabama', '2' = 'alaska', '4' = 'arizona', '5' = 'arkansas', '6' = 'california', '8' = 'colorado', '9' = 'connecticut', '10' = 'delaware', '11' = 'DC', '12' = 'florida', '13' = 'georgia', '15' = 'hawaii', '16' = 'idaho', '17' = 'illinois', '18' = 'indiana', '19' = 'iowa', '20' = 'kansas', '21' = 'kentucky', '22' = 'louisiana', '23' = 'maine', '24' = 'maryland', '25' = 'massachusetts', '26' = 'michigan', '27' = 'minnesota', '28' = 'mississippi', '29' = 'missouri', '30' = 'montana', '31' = 'nebraska', '32' = 'nevada', '33' = 'new hamshire', '34' = 'new jersey', '35' = 'new mexico', '36' = 'new york', '37' = 'north carolina', '38' = 'north dakota', '39' = 'ohio', '40' = 'oklahoma', '41' = 'oregon', '42' = 'pennsylvania', '44' = 'rhode island', '45' = 'south carolina', '46' = 'south dakota', '47' = 'tennessee', '48' = 'texas', '49' = 'utah', '50' = 'vermont', '51' = 'virginia', '53' = 'washington', '54' = 'west virginia', '55' = 'wisconsin', '56' = 'wyominng'))
y2015 <- y2015 %>% 
  select(state, overall, young_pop)

melt <- melt(y2015, id = "state")
head(melt)
ggplot(data=melt, aes(x=state, y=value, fill=variable)) + coord_flip() +
  geom_bar(stat='identity') + ggtitle("State Prison Population in 2015") +
  ylab("Number of Inmates") + xlab("State") + labs(fill = "Age Group") +
  theme(panel.background = element_rect(fill = "aliceblue", colour = "aliceblue"), 
  plot.title = element_text(hjust = 0.5, size = 15, face = "bold")) +
  scale_fill_manual(values = c('#E69F00', '#56B4E9')) +
  geom_text(aes(label = value), size = 3, vjust = 0.5, hjust = 1.5, color = "blue",        position = position_stack())

Overall Glimpse of Young Adults in State Prison

#loading state shapefile
states_map <- map_data("state")

map <- merge(states_map, state, by.x="region", by.y="state")
map <- arrange(map, group, order)
head(map)
ggplot(map, aes(x=long, y=lat, group=group, fill = n)) + geom_polygon(colour="grey") + coord_map("polyconic") + ggtitle("Number of Young Adults in State Prison") + labs(fill = "Age between 18-24")

Animated Mapping of Number of Young Adults in State Prison by Years

df <- merge(year, states_map, by.x = "state", by.y = "region")
df <- arrange(df, group, order)
head(df)
df$cat <- ifelse(df$n >= 20000, 8, ifelse(df$n >= 19999, 7, ifelse(df$n >= 14999, 6, ifelse(df$n >= 9999, 5, ifelse(df$n >= 4999, 4, ifelse(df$n >= 999, 3, ifelse(df$n >= 499, 2, 1)))))))
df$cat <-  factor(df$cat, levels = c(7:1), labels = c(">20000", "15000-19999", "10000-14999", "5000-9999", "1000-4999", "500-999", "<499"))

theme_opts <- list(theme(panel.grid.minor = element_blank(), panel.grid.major = element_blank(), panel.background = element_blank(), plot.background = element_blank(), panel.border = element_blank(), axis.line = element_blank(), axis.text.x = element_blank(), axis.text.y = element_blank(), axis.ticks = element_blank(), axis.title.x = element_blank(), axis.title.y = element_blank(), legend.position = "right", plot.title = element_text(size = 16)))

mymap <- ggplot(df, aes(x=long, y=lat, group=group, fill = cat)) + 
  theme_opts + coord_map("polyconic") + geom_polygon(color = "grey") + scale_fill_brewer(name = "# of Young Population", direction = -1, palette = "GnBu", type = "seq") +
  transition_states(df$RPTYEAR , transition_length = 7, state_length = 7, wrap = TRUE) + labs(title = "Number of Young Populationby State Prison in {closest_state}", subtitle = "Source: Inter-University Consortium for Political and Social Research")
gganimate::animate(mymap)

Conclusion:

California and Texas have a very large number of young adults incarcerated in state prison. The two states are the top two states that locked up the largest number of inmates across the all age groups as well. Further analysis of a group of young adult inmates can explore if the patterns and/or nature of criminal behaviors among those in the two states vary from that of their counterparts in other states.

Reference:

United States Department of justice. Office of Justice Progrms. Bureau of Justice Statistics. National Corrections Reporting Program, 1991-2015; Selected Variables. Ann Arbor, MI:Inter-university Consortium for Political and Social Research [distributor], 2018-03-02. [https://doi.org/10.3886/ICPSR36862.v1]