Publications by John Johnson
Personal data collection and analysis
Motivation behind this example I was diagnosed with sleep apnea last year, and have to use a continuous positive airway pressure (CPAP) machine to sleep well enough to feel alert during the day. The machine uploads data (via cellular connection) to a website that will give me results for the last two weeks. This data includes both usage (time of ...
7518 sym R (1966 sym/3 pcs) 2 img
How to make interactive maps with Census and local data in R
So the goal here is to focus back on Greenville County and have even more granularity. I look at median house prices near Greenville and then overlay the park data downloaded earlier. This time, for the Census data, I use the tidycensus package that came out recently. Furthermore, instead of using ggplot2 to create a static map, I use the leaflet...
3046 sym R (1669 sym/3 pcs) 2 img
How to make maps with Census data in R
US Census Data The US Census collects a number of demographic measures and publishes aggregate data through its website. There are several ways to use Census data in R, from the Census API to the USCensus2010 package. If you are interested in geopolitical data in the US, I recommend exploring both these options – the Census API requires a key f...
3276 sym R (7054 sym/13 pcs) 4 img 2 tbl
How we voted in South Carolina
Purpose This post seeks to explore how Greenville, SC and surrounding areas voted in the 2016 election. It also demonstrates how to retrieve data from the Data.World site. To retrieve data from this site using the tools in this post, you have to create an account (easy to do if you have a Facebook, Twitter, or Github account). You can then get yo...
6939 sym R (2241 sym/15 pcs) 12 img
A 3-way crosstab table using {gt} - 2020 RStudio Table Contest submission
Median annual wage for early-, mid-, and late-career workers by gender includes all full-time workers in the top 20 most common occupational categories from the 2014-18 American Community Survey occupation category1 Under 352 35 to 502 50 plus2 total jobs3 n4 obs5 Male Female Male Female Male Female Male Female Managers, nec (including P...
24971 sym R (11727 sym/26 pcs)
Analysis of Wisconsin Redistricting Plans submitted to the State Supreme Court
Data note The original version of this memo included all the plans submitted to the Wisconsin Supreme Court in December 2021. On January 10th, 2022, the Court accepted corrected versions of the Assembly and Senate redistricting plans submitted by Governor Evers and BLOC. This memo has been updated to include these small corrections from Evers and...
5119 sym 3 tbl
Analysis of Wisconsin Senate Redistricting Plans
Please note. Throughout this memo partisan baselines for each district are calculated as the average of the 2020 presidential, 2018 gubernatorial, and 2016 presidential elections. Seats “won” by either party are calculated by applying a uniform swing to this partisan baseline. This does not take into account incumbency effects. Partisan lean...
3296 sym 5 img 4 tbl
Analysis of Wisconsin Congressional Redistricting Plans
Please note. Throughout this memo partisan baselines for each district are calculated as the average of the 2020 presidential, 2018 gubernatorial, and 2016 presidential elections. Seats “won” by either party are calculated by applying a uniform swing to this partisan baseline. This does not take into account incumbency effects. Partisan lean...
2933 sym 4 img 4 tbl
Analysis of Wisconsin Assembly Redistricting Plans
Please note. Throughout this memo partisan baselines for each district are calculated as the average of the 2020 presidential, 2018 gubernatorial, and 2016 presidential elections. Seats “won” by either party are calculated by applying a uniform swing to this partisan baseline. This does not take into account incumbency effects. Partisan lean...
2465 sym 2 img 2 tbl
State Population Centers
After each Census, the Census Bureau calculates the nation’s “mean center of population.” Imagine a giant map of the United States with weights stacked on top corresponding to where people live. The center of population is that point at which you could balance that map on a pin. Here’s the national map with population centers from 1790 to...
2684 sym R (5554 sym/11 pcs) 1 img