Introduction to the 2018 election data

Interactive Data Visualization with plotly in R

Adam Loy

Statistician, Carleton College

The 2018 election

  • 435 seats in the House of Representatives
  • 35 seats in the Senate
  • 36 governors

Democrats

  • Recoup losses
  • Energize voters
  • Take control of legislative branch

Republicans

  • Keep voters engaged
  • Strengthen their position
  • Maintain momentum
Interactive Data Visualization with plotly in R

Voter turnout

McDonald, Michael P. 2018. "2018 November General Election Turnout Rates" United States Elections Project. Accessed Nov. 12, 2018.

glimpse(turnout)
Rows: 51
Columns: 7
$ state       <fct> Alabama, Alaska, Arizona, Arkansas, California, ...
$ state.abbr  <fct> AL, AK, AZ, AR, CA, CO, CT, DE, DC, FL, GA, HI, ...
$ turnout2018 <dbl> 0.474, 0.537, 0.486, 0.412, 0.478, 0.619, 0.526,...
$ turnout2014 <dbl> 0.332, 0.548, 0.341, 0.403, 0.307, 0.547, 0.425,...
$ ballots     <int> 1725000, 280000, 2385000, 895000, 12250000, 2540...
$ vep         <int> 3641209, 521777, 4910625, 2171940, 25635139, 410...
$ vap         <int> 3802714, 554426, 5519036, 2319740, 30836229, 444...
Interactive Data Visualization with plotly in R

Fundraising

glimpse(fundraising)
Rows: 2,412
Columns: 13
$ name         <fct> CUMMINGS, ELIJAH E, BROWN, ALVIN, ANGLE, SHARRON E, S...
$ id           <fct> H6MD07160, H8FL05140, H6NV02172, H2IL20042, H2PA15099...
$ office       <fct> H, H, H, H, H, H, H, H, H, H, H, H, H, H, H, H, H, H,...
$ state        <fct> MD, FL, NV, IL, PA, NJ, NH, AZ, KS, FL, MT, NC, CA, N...
...
$ receipts     <dbl> 944365.35, 450694.05, 52390.03, 1890067.19, 3926.00, ...
$ disbursement <dbl> 1051584.48, 447395.51, 34936.59, 1567978.53, 4705.16,...
$ cash.on.hand <dbl> 847733.69, 3298.54, 17568.45, 1158378.38, 64.36, -299...
$ debt.owed    <dbl> 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 314610.47, 0.00, ...
$ end.date     <fct> 10/17/18, 9/30/18, 9/30/18, 10/17/18, 9/30/18, 10/19/...
$ start.date   <fct> 1/1/17, 1/1/18, 10/1/17, 1/1/17, 1/1/17, 2/18/17, 4/1...
Interactive Data Visualization with plotly in R

Congressional results

glimpse(senate_winners)
Rows: 33
Columns: 7
$ name      <fct> SINEMA, KYRSTEN, FEINSTEIN, DIANNE, MURPHY, CHRISTOPH...
$ id        <fct> S8AZ00197, S0CA00199, S2CT00132, S8DE00079, S8FL00273...
$ state     <fct> AZ, CA, CT, DE, FL, HI, IN, MA, MD, ME, MI, MN, MO, M...
$ party     <fct> DEM, DEM, DEM, DEM, REP, DEM, REP, DEM, DEM, IND, DEM...
$ incumbent <fct> OPEN, INCUMBENT, INCUMBENT, INCUMBENT, CHALLENGER, IN...
$ votes     <int> 938976, 4777661, 818614, 217358, 4097689, 276133, 115...
$ pct.vote  <dbl> 48.87364, 54.44503, 59.42544, 61.31725, 50.07701, 71....
Interactive Data Visualization with plotly in R

Let's explore

Interactive Data Visualization with plotly in R

Preparing Video For Download...