import pandas as pd
import matplotlib.pyplot as plt
EJScreen: Environmental Justice Screening and Mapping Tool
Overview
This lesson introduces EJSCREEN, the EPA’s mapping tool that integrates environmental and demographic data into a consistent national framework. It enables users to visualize and analyze environmental burdens alongside socioeconomic indicators. The lesson demonstrates features of the tool, including mapping features, generating community reports, and comparing EJ indexes. A school district shapefile from Wayne County is then uploaded to EJScreen, which has boundaries based on school county.
The lesson also includes a Python component. Specifically, students will learn how to create bar graphs comparing separate regions using EJScreen-generated data in Python. While the lesson primarily focuses on using the web-based EJScreen tool, the Python portion enhances the analysis capabilities by allowing users to create custom visualizations of the data obtained from EJScreen reports. Participants learn to extract meaningful insights by leveraging EJScreen’s datasets and integrating Python for tasks like querying data and generating custom charts. This approach bridges technical and environmental sciences, fostering practical skills in analyzing equity and environmental health issues using programming.
Learning Objectives
After completing this lesson, you should be able to:
- Select and visualize Maps and Places available in EJScreen.
- Use the tools tab to create a report for the area of interest by drawing a polygon.
- Review and interpret the report outputs.
- Use the Tools section to upload census tract shapefile.
- Create bar graphs comparing separate regions from EJScreen generated graphs on Python.
- Interpret and compare different types of indexes.
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.
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/.
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.
You can use the search bar to explore a region. For this lesson, we will be focusing on Detroit, Michigan.
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.
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.
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.
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.
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).
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’.
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.
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.
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.
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.
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.
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.
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.
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.
Click on the save icon to export the data, and an excel file in .csv format will automatically download.
Explore the charts for Sterling Heights.
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/
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.
= pd.read_csv(r'data\\ejscreen_detroit.csv', header = 1) df_detroit
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.
print(df_detroit.shape)
#Read in Sterling Heights csv file.
= pd.read_csv(r'data\\ejscreen_sterlingheights.csv', header = 1)
df_sterlingheights
#Print the dataframe to examine the contents.
print(df_sterlingheights)
(50, 8)
# Category \
0 1 EJ Index
1 2 EJ Index
2 3 EJ Index
3 4 EJ Index
4 5 EJ Index
5 6 EJ Index
6 7 EJ Index
7 8 EJ Index
8 9 EJ Index
9 10 EJ Index
10 11 EJ Index
11 12 EJ Index
12 13 EJ Index
13 14 Environmental Burden
14 15 Environmental Burden
15 16 Environmental Burden
16 17 Environmental Burden
17 18 Environmental Burden
18 19 Environmental Burden
19 20 Environmental Burden
20 21 Environmental Burden
21 22 Environmental Burden
22 23 Environmental Burden
23 24 Environmental Burden
24 25 Environmental Burden
25 26 Environmental Burden
26 27 Socioeconomic
27 28 Socioeconomic
28 29 Socioeconomic
29 30 Socioeconomic
30 31 Socioeconomic
31 32 Socioeconomic
32 33 Socioeconomic
33 34 Socioeconomic
34 35 Socioeconomic
35 36 Socioeconomic
36 37 Socioeconomic
37 38 Supplemental Index
38 39 Supplemental Index
39 40 Supplemental Index
40 41 Supplemental Index
41 42 Supplemental Index
42 43 Supplemental Index
43 44 Supplemental Index
44 45 Supplemental Index
45 46 Supplemental Index
46 47 Supplemental Index
47 48 Supplemental Index
48 49 Supplemental Index
49 50 Supplemental Index
Selected Variables Value State Avg. \
0 EJ Index for Particulate Matter 2.5 NaN NaN
1 EJ Index for Ozone NaN NaN
2 EJ Index for Nitrogen Dioxide (NO2) NaN NaN
3 EJ Index for Diesel Particulate Matter NaN NaN
4 EJ Index for Toxic Releases to Air NaN NaN
5 EJ Index for Traffic Proximity NaN NaN
6 EJ Index for Lead Paint NaN NaN
7 EJ Index for Superfund Proximity NaN NaN
8 EJ Index for RMP Facility Proximity NaN NaN
9 EJ Index for Hazardous Waste Proximity NaN NaN
10 EJ Index for Underground Storage Tanks NaN NaN
11 EJ Index for Wastewater Discharge NaN NaN
12 EJ Index for Drinking Water Non-Compliance NaN NaN
13 Particulate Matter 2.5 (ug/m3) 8.7 7.84
14 Ozone (ppb) 70.2 67.3
15 Nitrogen Dioxide (NO2) (ppbv) 11 7.7
16 Diesel PM (ug/m3) 0.159 0.116
17 Toxic Releases to Air (toxicity-weighted conce... 1600 2500
18 Traffic Proximity and Volume (daily traffic co... 1300000 910000
19 Lead Paint (% pre-1960s housing) 0.11 0.38
20 Superfund Proximity (site count/km distance) 0.24 0.28
21 RMP Proximity (facility count/km distance) 0.33 0.38
22 Hazardous Waste Proximity (facility count/km d... 3.1 2
23 Underground Storage Tanks (count/km2) 4.5 7.6
24 Wastewater Discharge (toxicity-weighted concen... 36 880
25 Drinking Water Non-Compliance (points) 0.016 0.39
26 Demographic Index USA 0.84 NaN
27 Demographic Index State 0.87 1.18
28 Supplemental Demographic Index USA 1.53 NaN
29 Supplemental Demographic Index State 1.49 1.5
30 People of Color 19% 26%
31 Low Income 23% 31%
32 Unemployment Rate 5% 6%
33 Limited English Speaking Households 4% 2%
34 Population with Less Than High School Education 8% 9%
35 Population under Age 5 5% 5%
36 Population over Age 64 19% 18%
37 Supplemental Indexfor Particulate Matter 2.5 NaN NaN
38 Supplemental Index for Ozone NaN NaN
39 Supplemental Index for Nitrogen Dioxide (NO2) NaN NaN
40 Supplemental Index for Diesel Particulate Matter NaN NaN
41 Supplemental Index for Toxic Releases to Air NaN NaN
42 Supplemental Index for Traffic Proximity NaN NaN
43 Supplemental Index for Lead Paint NaN NaN
44 Supplemental Index for Superfund Proximity NaN NaN
45 Supplemental Index for RMP Facility Proximity NaN NaN
46 Supplemental Index for Hazardous Waste Proximity NaN NaN
47 Supplemental Index for Underground Storage Tanks NaN NaN
48 Supplemental Index for Wastewater Discharge NaN NaN
49 Supplemental Index for Drinking Water Non-Comp... NaN NaN
%ile in State USA Avg. %ile in USA
0 66.0 NaN 55.0
1 71.0 NaN 65.0
2 65.0 NaN 59.0
3 64.0 NaN 47.0
4 61.0 NaN 56.0
5 63.0 NaN 51.0
6 28.0 NaN 32.0
7 73.0 NaN 66.0
8 59.0 NaN 48.0
9 63.0 NaN 55.0
10 52.0 NaN 55.0
11 60.0 NaN 43.0
12 83.0 NaN 73.0
13 69.0 8.45 66.0
14 86.0 61.8 86.0
15 75.0 7.8 79.0
16 77.0 0.191 55.0
17 64.0 4600 69.0
18 71.0 1700000 60.0
19 23.0 0.3 37.0
20 74.0 0.39 73.0
21 63.0 0.57 54.0
22 72.0 3.5 68.0
23 56.0 3.6 77.0
24 70.0 700000 47.0
25 83.0 2.2 73.0
26 NaN 1.34 34.0
27 46.0 NaN NaN
28 NaN 1.64 49.0
29 55.0 NaN NaN
30 57.0 40% 36.0
31 42.0 30% 43.0
32 58.0 6% 62.0
33 89.0 5% 73.0
34 60.0 11% 52.0
35 58.0 5% 55.0
36 59.0 18% 62.0
37 75.0 NaN 68.0
38 82.0 NaN 82.0
39 74.0 NaN 76.0
40 73.0 NaN 58.0
41 69.0 NaN 70.0
42 72.0 NaN 66.0
43 27.0 NaN 34.0
44 74.0 NaN 71.0
45 62.0 NaN 53.0
46 72.0 NaN 71.0
47 54.0 NaN 62.0
48 70.0 NaN 49.0
49 83.0 NaN 73.0
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.
#Suffix ‘_dt’ for Detroit; ‘_sh’ for Sterling Heights.
= pd.merge(df_detroit, df_sterlingheights, on = ('#', 'Category', 'Selected Variables'), suffixes = ('_dt', '_sh'))
df_merge print(df_merge)
# Category \
0 1 EJ Index
1 2 EJ Index
2 3 EJ Index
3 4 EJ Index
4 5 EJ Index
5 6 EJ Index
6 7 EJ Index
7 8 EJ Index
8 9 EJ Index
9 10 EJ Index
10 11 EJ Index
11 12 EJ Index
12 13 EJ Index
13 14 Environmental Burden
14 15 Environmental Burden
15 16 Environmental Burden
16 17 Environmental Burden
17 18 Environmental Burden
18 19 Environmental Burden
19 20 Environmental Burden
20 21 Environmental Burden
21 22 Environmental Burden
22 23 Environmental Burden
23 24 Environmental Burden
24 25 Environmental Burden
25 26 Environmental Burden
26 27 Socioeconomic
27 28 Socioeconomic
28 29 Socioeconomic
29 30 Socioeconomic
30 31 Socioeconomic
31 32 Socioeconomic
32 33 Socioeconomic
33 34 Socioeconomic
34 35 Socioeconomic
35 36 Socioeconomic
36 37 Socioeconomic
37 38 Supplemental Index
38 39 Supplemental Index
39 40 Supplemental Index
40 41 Supplemental Index
41 42 Supplemental Index
42 43 Supplemental Index
43 44 Supplemental Index
44 45 Supplemental Index
45 46 Supplemental Index
46 47 Supplemental Index
47 48 Supplemental Index
48 49 Supplemental Index
49 50 Supplemental Index
Selected Variables Value_dt State Avg._dt \
0 EJ Index for Particulate Matter 2.5 NaN NaN
1 EJ Index for Ozone NaN NaN
2 EJ Index for Nitrogen Dioxide (NO2) NaN NaN
3 EJ Index for Diesel Particulate Matter NaN NaN
4 EJ Index for Toxic Releases to Air NaN NaN
5 EJ Index for Traffic Proximity NaN NaN
6 EJ Index for Lead Paint NaN NaN
7 EJ Index for Superfund Proximity NaN NaN
8 EJ Index for RMP Facility Proximity NaN NaN
9 EJ Index for Hazardous Waste Proximity NaN NaN
10 EJ Index for Underground Storage Tanks NaN NaN
11 EJ Index for Wastewater Discharge NaN NaN
12 EJ Index for Drinking Water Non-Compliance NaN NaN
13 Particulate Matter 2.5 (ug/m3) 9.67 7.84
14 Ozone (ppb) 69.3 67.3
15 Nitrogen Dioxide (NO2) (ppbv) 12 7.7
16 Diesel PM (ug/m3) 0.181 0.116
17 Toxic Releases to Air (toxicity-weighted conce... 3400 2500
18 Traffic Proximity and Volume (daily traffic co... 2800000 910000
19 Lead Paint (% pre-1960s housing) 0.84 0.38
20 Superfund Proximity (site count/km distance) 0 0.28
21 RMP Proximity (facility count/km distance) 0.59 0.38
22 Hazardous Waste Proximity (facility count/km d... 3.2 2
23 Underground Storage Tanks (count/km2) 16 7.6
24 Wastewater Discharge (toxicity-weighted concen... 15 880
25 Drinking Water Non-Compliance (points) 0.0062 0.39
26 Demographic Index USA 2.74 NaN
27 Demographic Index State 2.91 1.18
28 Supplemental Demographic Index USA 2.4 NaN
29 Supplemental Demographic Index State 2.38 1.5
30 People of Color 89% 26%
31 Low Income 57% 31%
32 Unemployment Rate 16% 6%
33 Limited English Speaking Households 2% 2%
34 Population with Less Than High School Education 16% 9%
35 Population under Age 5 7% 5%
36 Population over Age 64 15% 18%
37 Supplemental Indexfor Particulate Matter 2.5 NaN NaN
38 Supplemental Index for Ozone NaN NaN
39 Supplemental Index for Nitrogen Dioxide (NO2) NaN NaN
40 Supplemental Index for Diesel Particulate Matter NaN NaN
41 Supplemental Index for Toxic Releases to Air NaN NaN
42 Supplemental Index for Traffic Proximity NaN NaN
43 Supplemental Index for Lead Paint NaN NaN
44 Supplemental Index for Superfund Proximity NaN NaN
45 Supplemental Index for RMP Facility Proximity NaN NaN
46 Supplemental Index for Hazardous Waste Proximity NaN NaN
47 Supplemental Index for Underground Storage Tanks NaN NaN
48 Supplemental Index for Wastewater Discharge NaN NaN
49 Supplemental Index for Drinking Water Non-Comp... NaN NaN
%ile in State_dt USA Avg._dt %ile in USA_dt Value_sh State Avg._sh \
0 96.0 NaN 96.0 NaN NaN
1 94.0 NaN 96.0 NaN NaN
2 94.0 NaN 95.0 NaN NaN
3 95.0 NaN 86.0 NaN NaN
4 94.0 NaN 95.0 NaN NaN
5 95.0 NaN 94.0 NaN NaN
6 95.0 NaN 98.0 NaN NaN
7 0.0 NaN 0.0 NaN NaN
8 92.0 NaN 88.0 NaN NaN
9 92.0 NaN 90.0 NaN NaN
10 92.0 NaN 96.0 NaN NaN
11 89.0 NaN 72.0 NaN NaN
12 83.0 NaN 73.0 NaN NaN
13 96.0 8.45 85.0 8.7 7.84
14 70.0 61.8 84.0 70.2 67.3
15 84.0 7.8 85.0 11 7.7
16 88.0 0.191 55.0 0.159 0.116
17 84.0 4600 81.0 1600 2500
18 94.0 1700000 80.0 1300000 910000
19 90.0 0.3 94.0 0.11 0.38
20 0.0 0.39 0.0 0.24 0.28
21 75.0 0.57 67.0 0.33 0.38
22 73.0 3.5 69.0 3.1 2
23 83.0 3.6 94.0 4.5 7.6
24 58.0 700000 39.0 36 880
25 83.0 2.2 73.0 0.016 0.39
26 NaN 1.34 91.0 0.84 NaN
27 93.0 NaN NaN 0.87 1.18
28 NaN 1.64 86.0 1.53 NaN
29 89.0 NaN NaN 1.49 1.5
30 92.0 40% 88.0 19% 26%
31 86.0 30% 86.0 23% 31%
32 90.0 6% 92.0 5% 6%
33 82.0 5% 65.0 4% 2%
34 84.0 11% 74.0 8% 9%
35 74.0 5% 71.0 5% 5%
36 42.0 18% 46.0 19% 18%
37 95.0 NaN 95.0 NaN NaN
38 90.0 NaN 95.0 NaN NaN
39 91.0 NaN 93.0 NaN NaN
40 93.0 NaN 83.0 NaN NaN
41 92.0 NaN 93.0 NaN NaN
42 94.0 NaN 93.0 NaN NaN
43 93.0 NaN 96.0 NaN NaN
44 0.0 NaN 0.0 NaN NaN
45 89.0 NaN 84.0 NaN NaN
46 88.0 NaN 88.0 NaN NaN
47 90.0 NaN 94.0 NaN NaN
48 80.0 NaN 59.0 NaN NaN
49 83.0 NaN 73.0 NaN NaN
%ile in State_sh USA Avg._sh %ile in USA_sh
0 66.0 NaN 55.0
1 71.0 NaN 65.0
2 65.0 NaN 59.0
3 64.0 NaN 47.0
4 61.0 NaN 56.0
5 63.0 NaN 51.0
6 28.0 NaN 32.0
7 73.0 NaN 66.0
8 59.0 NaN 48.0
9 63.0 NaN 55.0
10 52.0 NaN 55.0
11 60.0 NaN 43.0
12 83.0 NaN 73.0
13 69.0 8.45 66.0
14 86.0 61.8 86.0
15 75.0 7.8 79.0
16 77.0 0.191 55.0
17 64.0 4600 69.0
18 71.0 1700000 60.0
19 23.0 0.3 37.0
20 74.0 0.39 73.0
21 63.0 0.57 54.0
22 72.0 3.5 68.0
23 56.0 3.6 77.0
24 70.0 700000 47.0
25 83.0 2.2 73.0
26 NaN 1.34 34.0
27 46.0 NaN NaN
28 NaN 1.64 49.0
29 55.0 NaN NaN
30 57.0 40% 36.0
31 42.0 30% 43.0
32 58.0 6% 62.0
33 89.0 5% 73.0
34 60.0 11% 52.0
35 58.0 5% 55.0
36 59.0 18% 62.0
37 75.0 NaN 68.0
38 82.0 NaN 82.0
39 74.0 NaN 76.0
40 73.0 NaN 58.0
41 69.0 NaN 70.0
42 72.0 NaN 66.0
43 27.0 NaN 34.0
44 74.0 NaN 71.0
45 62.0 NaN 53.0
46 72.0 NaN 71.0
47 54.0 NaN 62.0
48 70.0 NaN 49.0
49 83.0 NaN 73.0
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.
#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.
= df_merge[(df_merge['Category'] == 'EJ Index')]
ej_index_df
#Extracting the '%ile in State' for Detroit and Sterling Heights.
= ej_index_df['%ile in State_dt']
ej_index_detroit = ej_index_df['%ile in State_sh']
ej_index_sterlingheights
#Extracting the ‘Selected Variables.’
= ej_index_df['Selected Variables'] 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.
def remove_first_three_words(text):
#Splitting the string in between spaces.
= text.split()
words #Returning a new string that excludes the first three words.
return ' '.join(words[3:])
#Applying the function to the selected_variables dataframe.
= selected_variables.apply(remove_first_three_words) selected_variables
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.
#Configuring size of bar graph.
=(12, 8))
plt.figure(figsize= 0.35
bar_width
#Creating sequence of numbers from 0 to 12 for plotting the 13 indexes as labels.
= range(len(selected_variables)) index
<Figure size 1152x768 with 0 Axes>
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.
='Detroit')
plt.bar(index, ej_index_detroit, bar_width, label
+ bar_width for i in index], ej_index_sterlingheights, bar_width, label='Sterling Heights')
plt.bar([i
#Labeling the x-axis and y-axis.
'EJ Index')
plt.xlabel('%ile in State')
plt.ylabel('Comparison of EJ Index (%ile in State) between Detroit and Sterling Heights')
plt.title(+ bar_width/2 for i in index], selected_variables, rotation=45, ha='right')
plt.xticks([i
#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’.
For the right hand side, select ‘More’ for the theme of the map, choose Health Disparities as the service, and Asthma as the Layer.
The result should look similar to this:
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.
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?
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.