forked from ciesin-geospatial/TOPSTSCHOOL-air-quality
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm203-ejscreen.qmd
285 lines (172 loc) · 24.3 KB
/
m203-ejscreen.qmd
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
---
title: "EJScreen: Environmental Justice Screening and Mapping Tool"
format: html
author: "Elaine Famutimi and Camilla Green"
date: "December 3, 2024"
---
## Overview
In this lesson, we will learn how to use EJScreen, the Environmental Justice Screening and Mapping Tool developed by the Environmental Protection Agency. This tool allows one to map different types of indices with the option of generating reports and side by side comparisons. We will be focusing on Detroit, Michigan and surrounding areas, with a focus on racism and health.
## Learning Objectives
After completing this lesson, you should be able to:
- Create a polygon of an area of interest.
- Generate community reports and explore charts of an area of interest or boundary.
- Create bar graphs comparing separate regions from EJScreen generated graphs on Python.
- Interpret and compare different types of indexes.
- Access and add a shapefile to the EJScreen mapper.
## Introduction
### What is EJScreen?
EJScreen, the Environmental Justice Screening and Mapping Tool, was developed by the U.S. Environmental Protection Agency (EPA) to help identify and address environmental justice issues. The tool is designed to provide communities, NGOs, and policymakers with vital data on environmental and demographic factors that affect vulnerable populations.
### Background on the development of EJScreen
The concept of environmental justice gained prominence in the 1980s and 1990s when it became clear that certain communities, especially low-income and minority populations, were disproportionately affected by environmental hazards. This concern led to the signing of Executive Order 12898 in 1994, which directed federal agencies, including the EPA, to address environmental justice in minority and low-income populations \[https://www.epa.gov/laws-regulations/summary-executive-order-12898-federal-actions-address-environmental-justice\] (Zahra et al., 2009) (USAID, 2024)
### Importance of EJScreen
EJScreen is important in empowering communities. Access to EJScreen helps communities understand the specific environmental challenges they face, such as pollution levels or exposure to hazardous substances. By providing this data, the tool empowers residents to advocate for their health, safety, and well-being. According to the EPA, EJScreen allows communities to participate more effectively in public discussions, regulatory processes, and decision-making, backed by concrete data to support their concerns and needs. Environmental justice focuses on ensuring that no group of people, particularly minority and low-income communities, bears a disproportionate share of environmental burdens.\[https://www.epa.gov/ejscreen/what-ejscreen\] Environmental and social justice organizations often rely on data to build and support their campaigns. EJScreen provides this kind of data, which can highlight environmental injustices and help NGOs propose solutions and mobilize public support. Many NGOs also use these tools to strengthen their grant applications, demonstrating the specific needs of the communities they serve. This is especially important for organizations advocating for low-income and minority populations, who are often disproportionately impacted by environmental hazards. Policymakers require accurate data to create effective and equitable regulations. EJScreen helps identify areas of concern, prioritize actions, and design policies that better protect vulnerable populations. For example, the EPA uses this tool to inform regulatory actions, compliance monitoring, and enforcement activities.\[https://www.epa.gov/environmentaljustice\]. By making environmental data accessible to the public, EJScreen also promotes transparency and helps hold governments and industries accountable for their environmental impact. This public accessibility allows for trust and collaboration between communities, regulatory agencies, and policymakers, which is crucial for successfully implementing environmental policies \[https://www.epa.gov/environmentaljustice/national-environmental-justice-advisory-council\]. Environmental issues often require collaborative solutions involving multiple stakeholders, such as government agencies, NGOs, businesses, and community groups. EJScreen provides a common platform for discussing and addressing these challenges, which fosters more effective partnerships and solutions. EJScreen’s development reflects the EPA's commitment to enhancing the accessibility of environmental data, promoting transparency, and addressing environmental justice concerns by equipping all stakeholders with the tools needed to assess and respond to environmental health disparities.
::: callout-note
## Knowledge Check
What is the importance of EJScreen?
- Helping environmental and social justice organizations support their campaigns
- Providing policymakers with data to create effective regulations
- Empowering residents to advocate for their health and safety
- Providing a common platform for collaborative solutions between multiple stakeholders
- All of the above
:::
## How to use EJScreen?
To begin, click on the EJScreen link here: https://www.epa.gov/ejscreen. In that page, along with resources on how to use EJScreen, you will see a blue, bold text labeled “Launch the EJScreen Tool.” You can also go straight to the mapper using this link: https://ejscreen.epa.gov/mapper/.
![](docs/m203-ej-images/image9.png){fig-align="center"}
Once you click the link, you'll be directed to a Welcome screen. Here, you'll find an introduction, resource links, and a video overview of the tool. We recommend exploring these resources before proceeding. After that, close the Welcome dialog to continue.
![](docs/m203-ej-images/image13.png){fig-align="center"}
You can use the search bar to explore a region. For this lesson, we will be focusing on Detroit, Michigan.
![]()![](docs/m203-ej-images/image15.png){width="689"}
Type 'Metro Detroit' in the search bar to focus in on the metropolitan region of Detroit. Alternatively, you can use latitude and longitude coordinates. You can also zoom in or out of a region by clicking on the “+” or “-” icons on the bottom right.
![](docs/m203-ej-images/image11.png){fig-align="center"}
We can start exploring maps by noticing the Widget toolbar. Hovering your cursor over each icon will show the name of each tab. From right to left to right, the icons are ‘Maps’, ‘Places’, ‘Reports’, and ‘Tools.’ Clicking each icon will display a dropdown list of indicators to choose from. For now, we will focus on the ‘Maps’ icon.
![](docs/m203-ej-images/image28.gif){fig-align="center"}
Now, click on the Socioeconomic Indicators icon. Clicking that will expose seven types of socioeconomic indicators, and two indexes that can be explored. Click on People of Color, and your mapper should look like this. We will be mapping People of Color compared to the US. One can also compare it to just the state. To better view the map, one can click on the ‘\<’ on the Map widget.
![](docs/m203-ej-images/image2.png){fig-align="center"}
Notice the ‘Map Contents’ on the upper right. In statistics, a percentile is a score that shows how a particular score compares to other scores in a dataset. For example, people of color in the 95-100 percentile in a block group means that 95-100% of people living in that area are non-white. You can learn more about how EJScreen uses percentiles here <https://www.epa.gov/ejscreen/how-interpret-ejscreen-data>.
![](docs/m203-ej-images/image5.png){fig-align="center"}
You can hide the Map Contents by clicking on the sign. Noice the symbols in the Map Contents. To the right of that is the sign has the layer turned on; clicking on it turns it off. The allows you to view the metadata. On the opposite side, is an sign, which allows you to set the transparency of the map. A pop up with a sliding scale will appear when that is clicked. Clicking on removes the layer. Selecting provides a description of the index. Clicking minimizes the Map Contents pane, to expand it one can simply click on it again (this time the arrows will be pointing downwards).
::: callout-note
## FAIR Standards and Metadata
Metadata is structured information that describes a dataset. It is often thought of as "data about data," allowing users to understand the format, content, quality, temporality, and many more characteristics of data. Providing metadata is important for the FAIR (Findability, Accessibility, Interoperability, and Reusability) principles, helping users find and understand data.
:::
![](docs/m203-ej-images/image26.png){fig-align="center"}
One can generate reports and charts given an area of interest. Go to the ‘Reports’ tab. One option to select an area of interest is by drawing a polygon. Click on ‘Draw an Area’.
![](docs/m203-ej-images/image12.png){fig-align="center"}
Your cursor should turn into a crosshair. You can now click on the map and start drawing your polygon. Move your cursor over to where you want the next point of the polygon to be. To form the final polygon, just connect to the first point you made, and the polygon will turn into a transparent green.
![](docs/m203-ej-images/image33.gif){fig-align="center"}
A pop-up will appear where you can name your study area, add a buffer, download reports, and explore charts. Name it 'Detroit Study Area' to proceed.
![](docs/m203-ej-images/image31.png){fig-align="center"}
Clicking on EJScreen Community Report will open up a PDF file with detailed information about the study area. Let us explore this PDF. On the right side, you can find information about other characteristics of the community of interest, such as low income residents, the education level of residents, and the gender breakdown of the community. Right below Community Information is Breakdown By Race, which shows the percent of each race in this area. You will also find the percentage of age brackets, and limited English speaking breakdown.
![](docs/m203-ej-images/image3.png){fig-align="center"}
On the left side of the document, there is be a map showing the study area, including the legend from the Map Contents tab. Centering the map or zooming in or out on the Mapper will result in a different view on the report. This view will also highlight the languages spoken at home.
![](docs/m203-ej-images/image25.png){fig-align="center"}
Page 2 of the report presents bar graphs comparing EJ indexes at state and national levels. Review these graphs for differences in environmental factors like drinking water non-compliance and wastewater discharge. Note: Although the graph does not include wastewater discharge, the table below shows values for each index from left to right.
![](docs/m203-ej-images/image8.png){fig-align="center"}
![](docs/m203-ej-images/image27.png){fig-align="center"}
![](docs/m203-ej-images/image4.png){fig-align="center"}
Let's compare this report to one generated outside of Detroit. Try to pick an area that shows a lower percentile of people of color, or less red, like Sterling Heights or Westland. What differences do you see? Are the EJ indexes higher or lower?
One can also view other reports, and download excel data. Lets compare the bar graphs in a red population of Detroit and a region in Sterling Heights. Delete the original polygon and create new ones within those regions.
![](docs/m203-ej-images/image24.png){fig-align="center"}
Click on a polygon and select ‘Explore Charts.’ A pop up will open, showing tabs for Environmental Justice Indexes, Environmental Burden Indicators, Socioeconomic Indicators, and Supplemental Indexes. Placing the cursor over each bar will show the exact percentile for each index. You can also unselect and select indexes of your choosing. For now, let's keep all of them selected. We will also only focus on the USA percentile. Environmental Justice Indexes, Environmental Burden Indicators, and Supplemental Indexes focus on the same environmental indexes. Selecting the Socioeconomic indicators will list different types of indexes focusing on socioeconomic factors.
![](docs/m203-ej-images/image7.png){fig-align="center"}
One can also explore the Socioeconomic (ACS) Report, which includes data from the US Census Bureau American Community Survey (ACS). Select Get Data Table, and a tabular view of the data should pop up. This will include all the categories, selected variables, percentile in state and percentile in USA.
![](docs/m203-ej-images/image16.png){fig-align="center"}
Click on the save icon![](docs/m203-ej-images/image22.png) to export the data, and an excel file in .csv format will automatically download.
Explore the charts for Sterling Heights.
![](docs/m203-ej-images/image14.png){fig-align="center"}
Notice the lower percentiles for the EJ Indexes. Is this data in line with what was seen in the generated report? Download the data for this as well.
Let's perform some basic data analysis!
We can now use this data to create graphs on our own and better visually compare the indexes between separate regions. Let us compare the data for Sterling Heights and the region we selected in the metro area of Detroit. Save the files that were downloaded in a working directory, and rename them so that it makes sense. One file can be named ejscreen_detroit and the other ejscreen_sterlingheights. Open one of the csv files and take note of how the data is formatted. Under the main header that describes the EPA region, there should be 8 columns, each one with its own header (Category, Selected Variables, etc.) The Category column has the category of each index and indicator. The Selected Variables are the indexes for each category. For the EJ Indexes category, you should see 13 indexes in the Selected Variable column. To work with these files, we will be using the pandas library, which allows us to handle and manipulate excel files as a dataframe.
Import the pandas and matplotlib libraries. Documentation for pandas can be found here https://pandas.pydata.org/docs/, and for matplotlib, here https://matplotlib.org/stable/users/getting_started/
```{python}
import pandas as pd
import matplotlib.pyplot as plt
```
In order to use the data that you just downloaded as a CSV file, you have to tell the computer to read the CSV. The pandas read_csv() function reads CSV files. You can specify if the data has a header by adding header = 1, otherwise it treats the column names as part of the data. By specifying the header, it is extracting the column names we noticed in the CSV file and treating them as the header. Reading these files will now turn the csv files into a dataframe.
```{python}
df_detroit = pd.read_csv(r'/Users/camillapaige/Documents/code/TOPSTSCHOOL-air-quality/docs/ejscreen_detroit.csv', header = 1)
```
Printing out the shape of the dataframe lets one see the number of rows and columns the data has. It is important to know the dimensions of your data before performing any analysis on it, to ensure that you will be correctly manipulating the data. You can also print just the dataframe variable for Sterling Heights and/or Detroit. The output looks like the contents in the CSV file.
```{python}
print(df_detroit.shape)
#Read in Sterling Heights csv file.
df_sterlingheights = pd.read_csv(r'/Users/camillapaige/Documents/code/TOPSTSCHOOL-air-quality/docs/ejscreen_sterlingheights.csv', header = 1)
#Print the dataframe to examine the contents.
print(df_sterlingheights)
```
We are going to merge the dataframes using the pandas merge() function. The merge function combines dataframes using a chosen parameter. For this case, we will be merging using the ‘#’, ‘Category’, and ‘Selected Variables’ column. The ‘on’ parameter chooses which column both dataframes will join on; the columns must be found in both dataframes. Since the ‘#’, ‘Category’, and ‘Selected Variables’ columns are the same in both dataframes, we will merge on those columns, meaning that the final dataframe will only have one of each of those columns. The rest of the columns will double, and the numbers of rows will remain the same. The ‘suffixes’ parameter allows you to add a suffix to the columns to help identify which column belongs to which dataset. Since the ‘Value’, ‘State Avg.’, %ile in State, USA Avg., and %ile in USA differ between the two datasets, those column headers will carry the suffixes.
```{python}
#Suffix ‘_dt’ for Detroit; ‘_sh’ for Sterling Heights.
df_merge = pd.merge(df_detroit, df_sterlingheights, on = ('#', 'Category', 'Selected Variables'), suffixes = ('_dt', '_sh'))
print(df_merge)
```
Extract the 'EJ Index' rows from the ‘Category’ columns, the corresponding '%ile in State' values and the ‘Selected Variables’ for the Detroit and Sterling Heights.
```{python}
#Extracting only the rows that have ‘EJ Index’ as the category from the merged dataframe, and turning it into a new dataframe called ‘ej_index_df’ that only has that category. The rest of the variables will be extracted from this dataframe.
ej_index_df = df_merge[(df_merge['Category'] == 'EJ Index')]
#Extracting the '%ile in State' for Detroit and Sterling Heights.
ej_index_detroit = ej_index_df['%ile in State_dt']
ej_index_sterlingheights = ej_index_df['%ile in State_sh']
#Extracting the ‘Selected Variables.’
selected_variables = ej_index_df['Selected Variables']
```
Notice how each of the indexes in the selected variables dataframe starts with ‘EJ Index for’ before the name of the index. When we plot this, the x axis will have the label of ‘EJ Index’, so having it before each index seems redundant. We can remove the first three words by using the .split() function. We will create a function that removes the first three words of each of the indexes in the selected_variables dataframe, and then returns the remaining words. Each selected variable is a string, which in this case, is a sequence of words. The .split() function, without specifying any parameters, splits the string into individual words. The .join() function then combines the separate words back into a string.
::: callout-note
A function is a unit of code that performs a specific task. Its main advantage is that it can be reused, making code more efficient. def() is the keyword used to define the function, and is placed before the name of the function. What goes in the parentheses is the optional parameters, which are the input values. Sometimes, a function ends with ‘return’, which outputs a specific value from the function.
:::
```{python}
def remove_first_three_words(text):
#Splitting the string in between spaces.
words = text.split()
#Returning a new string that excludes the first three words.
return ' '.join(words[3:])
#Applying the function to the selected_variables dataframe.
selected_variables = selected_variables.apply(remove_first_three_words)
```
A bar graph can now be created using the information that was extracted. The ‘index’ variable is storing a sequence of indices from 0 to the length of selected_variables minus 1. The len() function calculates the size of the selected_variables dataframe, which is 13 since there are 13 indexes. The range() function then creates a sequence of numbers starting from 0 to minus 1 of the length of selected variables.
```{python}
#Configuring size of bar graph.
plt.figure(figsize=(12, 8))
bar_width = 0.35
#Creating sequence of numbers from 0 to 12 for plotting the 13 indexes as labels.
index = range(len(selected_variables))
```
plt.bar(index, ej_index_detroit, bar_width, label='Detroit') plots a series of bars at the x-positions specified by index and sets the height according to the ej_index_detroit values, with each bar having a width defined by the bar_width variable. The second line, plt.bar(\[i + bar_width for i in index\], ej_index_sterlingheights, bar_width, label='Sterling Heights'), plots another series of bars that are shifted to the right by bar_width per each index value to position them next to the Detroit bars. Using only ‘index’ without the adjustment overlaps the bars instead. A similar thing is done to plot the x ticks in the plt.xticks(\[i + bar_width/2 for i in index\], selected_variables, rotation=45, ha='right') line, where selected_variables is used as the labels at a 45 degree angle, and ensures that the ticks and labels are positioned between the Detroit and Sterling Heights bars.
```{python}
plt.bar(index, ej_index_detroit, bar_width, label='Detroit')
plt.bar([i + bar_width for i in index], ej_index_sterlingheights, bar_width, label='Sterling Heights')
#Labeling the x-axis and y-axis.
plt.xlabel('EJ Index')
plt.ylabel('%ile in State')
plt.title('Comparison of EJ Index (%ile in State) between Detroit and Sterling Heights')
plt.xticks([i + bar_width/2 for i in index], selected_variables, rotation=45, ha='right')
#Adding a legend
plt.legend()
plt.tight_layout()
plt.show()
```
What conclusions can you draw from looking at the resulting bar graph?
Next, we can start mapping other indexes. Let's increase our study area. Go back to the mapper and zoom out so that you can see the metro area of Detroit, and the surrounding area, up to around Sterling Heights. Delete the polygons that were created by selecting them and choosing “Delete this site.”
We are going to do some side by side map comparisons of other indexes. Go to tools and select ‘Side by Side Map Comparisons.’ That will take you to a different web page which should show a left and right hand side of the map. At the top, on the right hand side, click on “Map Data”. A tab similar to the mapper should appear. Select Threshold map for the theme of the map, choose EJ Indexes as type of Index, and Compare to US for location. Keep the lower and upper bounds the same. Select ‘Particulate Matter 2.5’. Then click on ‘Update Map’.
![](docs/m203-ej-images/image34.png){fig-align="center"}
For the right hand side, select ‘More’ for the theme of the map, choose Health Disparities as the service, and Asthma as the Layer.
![](docs/m203-ej-images/image32.png){fig-align="center"}
The result should look similar to this:
![](docs/m203-ej-images/image29.png){fig-align="center"}
Expand the Legend to further understand the data. Do you see a correlation between the data? Play around with the comparisons. Try choosing People of Color while keeping asthma.
You can also create reports based on boundaries. Under Tools, select Boundaries. The Map Contents will show you several types of boundaries you can add to your maps, like zip codes, counties, etc. You can generate reports based on these boundaries, and boundaries you want to import, as well.
We can add a shapefile to the Mapper. Head on to the Wayne County datapage \[https://www.waynecounty.com/departments/technology/gis-data.aspx\]. The page has different datasets under the label “GIS Data”, including “Commission Districts”, “Municipal Boundaries”, etc. Please click on the one labeled “School Districts”. A zip file will immediately download. Once it is done downloading, unzip the contents into a folder.
Next, go to Tools, select Add Shapefile, and then select Add File.
![](docs/m203-ej-images/image6.png){fig-align="center"}
Now, you can generate reports for each school district. What conclusions do you think you can come to by comparing school districts that overlay high percentiles of certain indexes or indicators, in Detroit and other counties?
![](docs/m203-ej-images/image21.png){fig-align="center"}
Feel free to explore EJScreen more. There are many additional analyses you can perform with this helpful tool. If you ever want to come back to your work, you can save it as a session. In Tools, select Save Session, and add a name to it. Select save, and then under Actions, select ‘Save to File.’ Your session will be downloaded as a .json, which can then be added back in a later time by selecting ‘Load from file’ and choosing the .json file from your folder. For more information, please check out the EJScreen User Guide: https://ejscreen.epa.gov/mapper/help/ejscreen_help.pdf
## Conclusion
Congratulations! Now you should be able to:
- Map different types of indices and understand percentiles on the Map Contents.
- Interpret the results of the Community Report and understand demographic and indices information for a specific area.
- Generate charts and download the charts as an excel file to use for simple data analysis.
- Create a side by side comparison of health disparities and socioeconomic indexes.
- Upload a shapefile to the EJScreen Mapper.
## Continue to Lesson 4
[Lesson 3](https://ciesin-geospatial.github.io/TOPSTSCHOOL-air-quality/m204-grdiv1-pm25.html){.btn .btn-primary .btn role="button"}