-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.Rmd
176 lines (138 loc) · 9.44 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
title: "A3 - Incarceration Trends"
author: "Kara Pugh"
date: '2022-05-22'
output: html_document
---
### Introduction
In the United States racism and racial prejudice have consistently been issues that negatively
affect minorities. One institution in particular where the affects of these issues can be clearly
seen is the United States' prison system. In the US, African Americans are viewed as "dangerous" and
more likely to commit crimes which in turn has led to African Americans being incarcerated much more often than people of other races.
For my analysis, I have chosen to specifically focus on data from US prisons since prisons are usually for those who have commited more serious offenses. Also, I have chosen to further narrow down my data by just looking at the prisons in Texas. I specifically chose Texas because it is the state with the most prisons and the most prisoners. The variables that I have chosen to analyze are the number of prisoners for each race. I wanted to see how race affected the overall population in prison. In my dataset, I kept the total populations of each race from 15 to 64 in order to see how the number of prisoners in each race compared to the overall total of people of that race. I also kept the total number of prisoners so that I could compare how each race compared to the overall prison population. By analyzing these variables I hoped to gain a better understanding of how the prison system is affected by race and how certain patterns regarding race unveil a problematic correlation between race and incarceration that should not be ignored.
```{r setup, include = FALSE, warning=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(dplyr)
library(ggplot2)
library(usmap)
incarceration_trends <- read.csv("https://raw.githubusercontent.com/vera-institute/incarceration-trends/master/incarceration_trends.csv")
prison_race <- incarceration_trends %>%
filter(state == "TX") %>%
select(year, county_name, fips, aapi_prison_pop, black_prison_pop,
latinx_prison_pop, native_prison_pop, white_prison_pop,
total_prison_pop, aapi_pop_15to64, black_pop_15to64,
latinx_pop_15to64, native_pop_15to64, white_pop_15to64)
prison_race <- na.omit(prison_race)
prison_pop_means <- prison_race %>%
summarise_at(vars("native_prison_pop", "aapi_prison_pop", "black_prison_pop", "latinx_prison_pop", "white_prison_pop"), mean)
aapi_mean <- prison_pop_means[1, "aapi_prison_pop"]
black_mean <- prison_pop_means[1, "black_prison_pop"]
latinx_mean <- prison_pop_means[1, "latinx_prison_pop"]
native_mean <- prison_pop_means[1, "native_prison_pop"]
white_mean <- prison_pop_means[1, "white_prison_pop"]
# What proportion of people from each race make up the the prison population?
prison_pop_prop <- prison_race %>%
mutate(aapi_pop_prop = aapi_prison_pop/total_prison_pop) %>%
mutate(black_pop_prop = black_prison_pop/total_prison_pop) %>%
mutate(latinx_pop_prop = latinx_prison_pop/total_prison_pop) %>%
mutate(native_pop_prop = native_prison_pop/total_prison_pop) %>%
mutate(white_pop_prop = white_prison_pop/total_prison_pop) %>%
select(year, county_name, aapi_pop_prop, black_pop_prop, latinx_pop_prop, native_pop_prop, white_pop_prop)
prison_pop_prop[is.na(prison_pop_prop)] <- 0
prison_pop_prop_means <- prison_pop_prop %>%
summarise_at(vars("aapi_pop_prop", "black_pop_prop", "latinx_pop_prop", "native_pop_prop", "native_pop_prop", "white_pop_prop"), mean)
aapi_pop_prop_mean <- prison_pop_prop_means[1, "aapi_pop_prop"]
black_pop_prop_mean <- prison_pop_prop_means[1, "black_pop_prop"]
latinx_pop_prop_mean <- prison_pop_prop_means[1, "latinx_pop_prop"]
native_pop_prop_mean <- prison_pop_prop_means[1, "native_pop_prop"]
white_pop_prop_mean <- prison_pop_prop_means[1, "white_pop_prop"]
# What is the proportion of people in prison for each race?
prison_proportions <- data.frame(prison_race)
prison_proportions <- prison_race %>%
mutate(aapi_prop = aapi_prison_pop/aapi_pop_15to64) %>%
mutate(black_prop = black_prison_pop/black_pop_15to64) %>%
mutate(latinx_prop = latinx_prison_pop/latinx_pop_15to64) %>%
mutate(native_prop = native_prison_pop/native_pop_15to64) %>%
mutate(white_prop = white_prison_pop/white_pop_15to64) %>%
select(year, county_name, aapi_prop, black_prop, latinx_prop, native_prop, white_prop)
# What is the maximum proportion of people in prison for each race?
prison_proportions[is.na(prison_proportions)] <- 0
aapi_max_prop <- max(prison_proportions$aapi_prop)
black_max_prop <- max(prison_proportions$black_prop)
latinx_max_prop <- max(prison_proportions$latinx_prop)
native_max_prop <- max(prison_proportions$native_prop)
white_max_prop <- max(prison_proportions$white_prop)
# Which county has the most black prisons? The highest black proportion?
most_black_prisoners <- prison_race %>%
filter(black_prison_pop == max(prison_race$black_prison_pop)) %>%
pull(county_name, black_prison_pop)
highest_black_prop <- prison_proportions %>%
filter(black_prop == black_max_prop) %>%
pull(county_name, black_prop)
counties_prison_pop <- prison_race %>%
select(year, county_name, fips, black_prison_pop) %>%
group_by(county_name) %>%
filter(year == max(year))
# Which county has the most prisoners?
most_prisoners <- prison_race %>%
filter(total_prison_pop == max(prison_race$total_prison_pop)) %>%
pull(county_name)
# data for just Harris county
harris_county <- prison_race %>%
filter(county_name == "Harris County") %>%
select(year, county_name, black_prison_pop, white_prison_pop)
# data for just Anderson county
anderson_county <- prison_proportions %>%
filter(county_name == "Anderson County") %>%
select(year, county_name, black_prop, white_prop)
```
### Summary Information
In the Texas prison systems the average number of black prisoners is much **higher** than the average
number of prisoners for other races with the mean for black prisoners being `r black_mean` and the
mean for latinx prisoners, white prisoners, Asian American/Pacific Islander prisoners, and native
prisoners being `r latinx_mean`, `r white_mean`, `r aapi_mean`, and `r native_mean` respectively.
The average proportion of black prisoners compared to the total prison population
(black prisoners/total prisoners) is `r black_pop_prop_mean` which is significantly higher than both
Asian American/Pacific Islander prisoners (`r aapi_pop_prop_mean`) and native prisoners (`r native_pop_prop_mean`). But not quite as high as white prisoners (`r white_pop_prop_mean`) and latinx
prisoners (`r latinx_pop_prop_mean`) since white and latinx make up a vast majority of the population
in Texas. However, when we look at each race individually the data is no longer skewed by the larger general populations of whites and latinx and we see that African Americans are disproportionately incarcerated. Comparing the number of people from each race in prison versus that race's overall population per county (ie. black prisoners/black population) we see that the proportion of the black population in prison is much higher than the proportion for other races. The maximum proportion of black people in prison is `r black_max_prop` while the maximum proportion of people in prison for white and latinx people does not even reach 0.1 even though they make up the majority of Texas' population.
### Charts
I chose to include this chart for two reasons. First, it displays how across multiple races the number
of prisoners is declining. Secondly, it visually shows how the number of black prisoners is consistently higher than the number of white prisoners. Also, I specifically chose Harris County because it is the county with the most prisoners.
```{r, echo=FALSE}
harris_county %>%
tail(14) %>%
ggplot( aes(x=year)) +
geom_line(aes(y=black_prison_pop), color="blue") +
geom_line(aes(y=white_prison_pop), color="red") +
ylab("Prison Population") +
geom_point(aes(y=black_prison_pop), shape=21, color="black", fill="#69b3a2", size=6) +
geom_point(aes(y=white_prison_pop), shape=24, color="black", fill="#E69F00", size=6) +
theme(legend.position = "right") +
ggtitle("Black and White Prisoners in Harris County")
```
- Races
- Black = teal circle
- White = yellow triangle
I chose to include this chart because it displays how the proportion of black prisoners relates to the proportion of white prisoners in Anderson county. Also, from the chart we can see that for the most part the proportion of white people does not go past a certain level, while the proportion of black people is distributed throughout the graph.
```{r, echo=FALSE}
ggplot(anderson_county, aes(x=black_prop, y=white_prop)) +
geom_point(
color="orange",
fill="#69b3a2",
shape=21,
alpha=0.5,
size=6,
stroke = 2
) +
xlab("Proportion of Black People in Prison") +
ylab("Proportion of White People in Prison")
```
### Map
I chose to include this map because it provides a good visualization of how many black prisoners there are in each Texas county. From the map it is clear that there are some counties that have a very large number of black prisoners and some that do not have a very many. In other words, the distribution is concentrated in a few specific counties.
```{r, echo=FALSE}
plot_usmap(data = counties_prison_pop, region = "counties", values = "black_prison_pop", include = "TX", color = "blue") +
scale_fill_continuous(low = "white", high = "blue", name = "Black Prison Population", label = scales::comma) +
labs(title = "Texas Black Prison Populations per County", subtitle = "using the most recent year available for each county") +
theme(legend.position = "right")
```