Exploring the Urban-Rural Divide through Politicians’ Social Media
By: Luke Mckinstry
Tags: Dataviz, Geospatial, Social Media

Demographic and Social Media Differences in Urban and Rural districts

Beyond the map, to look for demographic patterns in the way elected officials use social media, we created a data pipeline to gather statistics from the US Census for each district. Here is a summary of the variables that we collected segmented by officials who use the social media platforms Facebook and Twitter.

Breakdown by Social Media Platform

Collecting Census Data for Political Districts

Before detailing and visualizing the findings in the next section, first, we will summarize how we gathered the data. We used the 2017 American Community Survey (ACS) — a data set that is released annually and contains detailed information on the demographic and socioeconomic landscape of the United States. We collected information available at the Census Tract level, which is near the bottom of the US Census hierarchy.

US Census Geographic Hierarchy

For each census tract, we used the Census API to collect the following information:

Population

Median Household Income

Median Age

Percent with Internet Access

For a guide to variables available in the ACS, click here. For sample Census API calls visit here.

We then aggregated this information to the district boundaries for all state legislative officials and local officials. District boundaries for state legislatures are available here from the US Census for upper chambers (SLDU) and lower chambers (SLDL). For example, you can download the 2017 file for the Pennsylvania (GEOID: 42) General Assembly (SLDL) with curl https://www2.census.gov/geo/tiger/GENZ2017/shp/cb_2017_42_sldl_500k.zip . Boundaries from local chambers are harder to come by but can often be found on open data portals. In total, we collected roughly 7,000 state districts and 3,000 local districts.

Political districts at the state and local level do not align perfectly to Census Tracts, so we used an area weighted join to aggregate the data.

Designating Urban and Rural Areas

It is key to this analysis to understand which officials represent urban and rural areas. Population density is an imperfect classifier. Instead, we used the US Census Urban Rural Criteria — which can be roughly summarized as areas either 1) meeting a high population density threshold or 2) meeting a lower population density threshold and having proximity to a place above the higher threshold. 2010 Census Urban Areas are shown below.

2010 Census United States Urban Areas

Source: QGIS Documentation

For each of the 10,000 districts where we collected boundaries and demographic statistics, we needed to determine what percentage of the district was within an urban area. To accomplish this, we collected the national shapefile of US urban areas. Next, we used an intersection to calculate the percentage of each political district within an urban area.

Joining Cicero Data to Census Data with OpenCivicData Identifiers

Cicero is a comprehensive database of elected officials and legislative districts. Cicero enables you to match constituents with their representatives based on address-level data, leading to endless possibilities.

To understand the social media accounts of the officials representing each of the 10,000 districts we previously collected, we gathered their records from Cicero. Merging the elected official records to the district boundary and demographics data set is a 1:1 join operation (or many:1 when multiple officials represent a district). OpenCivicData Identifiers (OCD-IDs) are an open standard for defining civic data — and make it possible to match political district records from different data sources.

Cicero makes OCD-IDs available in a standard API response. Census state legislative boundaries (the sldl and sldu files from the previous section) use a different identifier for districts, so there is a key file from the OpenCivicData Foundation that makes it possible to match a census district ID to the OCD-ID identifier. After executing this join, we are left with a dataset consisting of the following:

Political district boundary (from the sldl and sldu files for state officials, and Cicero for local officials)

Demographic data from the 2017 ACS for the district (collected from the Census API)

Elected official biographical and social media information form Cicero.

Viewing the Dataset

State and Local Districts with Highest Median Household Income

State and Local Districts with Lowest Median Household Income

State and Local Districts with Highest Percent Households with Internet Access

State and Local Districts with Lowest Percent Households with Internet Access

Analysis and Key Takeaways

To view distributions and relationships between variables, we use a facetgrid from Seaborn, a Python data visualization library based on Matplotlib.

Political district demographics, segmented by type of social media missing

Three Initial takeaways:

There is a linear relationship between Median Household Income and Percent Internet Access. This plot will be useful to show demographics and characteristics of districts. For Internet Access, there are distinct distributions for districts where the official uses both Facebook and Twitter versus districts where officials are not using one or both services. Percent Urban is a bimodal distribution. Most officials represent either an entirely urban or entirely rural district. In other words, few officials represent districts with a mix of urban and rural constituents. This certainly supports the urban-rural divide idea. (Perhaps larger US congressional districts have a greater mix of urban and rural areas )

Key Insight: In the Percent Urban distribution plot, we see clearly distinct distributions for districts where the official uses both Facebook and Twitter, uses just one of Facebook or Twitter, or uses neither.

It turns out, this is entirely due to differences between urban and rural state legislative officials. In the next plot, we remove local officials, who mostly serve entirely urban districts. (This is by design since Cicero primarily carries local data for cities with a population over 100,000, which easily meets the US Census criteria for Urban).

Major Divergence in State Legislatures

We found substantial differences in how officials in state legislatures use social media corresponding to whether they represent urban or rural areas. So, looking at Percent Urban distributions segmented by official social media usage is the most informative.

Percent urban distribution in state legislative districts, segmented by type of social media missing. Note: This graph displays interpolated data values

Officials with Facebook and Twitter have an equal distribution between urban and rural districts. In other words, lots of officials carry both forms of social media.

The 3 distributions of officials missing social media skew rural:

The distribution of officials missing only Twitter is heavily skewed towards rural areas. Similarly, the distribution of officials missing both Facebook and Twitter is also heavily skewed towards rural areas. Officials missing only Facebook are more commonly rural than urban, but the distribution is far less skewed than for officials missing a Twitter or officials missing both Facebook and Twitter.

Back to the original question again — do patterns in the way elected officials use social media reflect the urban-rural divide in politics? We see compelling signs that the answer is YES. While many officials across the demographic spectrum have adopted social media, urban officials favor Twitter, and rural officials favor using only Facebook, or abstain from social media altogether and presumably communicate through other means.

State by State Plots

Since this analysis involved thousands of elected officials and their districts, it would be informative to break down this data to the state level. The photo scroll below plots social media use, median household income, and internet access in each state. This granular level provides insights into the specific data points discussed.

Click Here to View All 50 State by State Plots