Interactive Course

Analyzing Election and Polling Data in R

Learn R for data science by wrangling, visualizing, and modeling political data like polls and election results.

  • 4 hours
  • 15 Videos
  • 55 Exercises
  • 2,947 Participants
  • 4,650 XP

Loved by learners at thousands of top companies:

rei-grey.svg
t-mobile-grey.svg
airbnb-grey.svg
ikea-grey.svg
mls-grey.svg
dell-grey.svg

Course Description

This is an introductory course to the R programming language as applied in the context of political data analysis. In this course students learn how to wrangle, visualize, and model data with R by applying data science techniques to real-world political data such as public opinion polling and election results. The tools that you'll use in this course, from the dplyr, ggplot2, and choroplethr packages, among others, are staples of data science and can be used to analyze almost any dataset you get your hands on. Students will learn how to mutate columns and filter datasets, graph points and lines on charts, make maps, and create models to understand relationships between variables and predict the future. This course is suitable for anyone who already has downloaded R and knows the basics, like how to install packages.

  1. 1

    Presidential Job Approval Polls

    Free

    Chapter one uses a dataset of job approval polling for US presidents since Harry Truman to introduce you to data wrangling and visualization in the tidyverse.

  2. Election Results and Political Demography

    This chapter teaches you how to make maps and understand linear regression in R. With election results from the United States and the United Kingdom, you'll also learn how to use regression models to analyze the relationship between two (or more!) variables.

  3. U.S. House and Senate Polling

    In this chapter, you will embark on a historical analysis of "generic ballot" US House polling and use data visualization and modeling to answer two big questions: Has the country changed over time? Can polls predict elections?

  4. Predicting the Future of Politics

    In this ensemble of applied statistics and data analysis, you will wrangle, visualize, and model polling and prediction data for two sets of very important US elections: the 2018 House midterms and 2020 presidential election.

  1. 1

    Presidential Job Approval Polls

    Free

    Chapter one uses a dataset of job approval polling for US presidents since Harry Truman to introduce you to data wrangling and visualization in the tidyverse.

  2. U.S. House and Senate Polling

    In this chapter, you will embark on a historical analysis of "generic ballot" US House polling and use data visualization and modeling to answer two big questions: Has the country changed over time? Can polls predict elections?

  3. Election Results and Political Demography

    This chapter teaches you how to make maps and understand linear regression in R. With election results from the United States and the United Kingdom, you'll also learn how to use regression models to analyze the relationship between two (or more!) variables.

  4. Predicting the Future of Politics

    In this ensemble of applied statistics and data analysis, you will wrangle, visualize, and model polling and prediction data for two sets of very important US elections: the 2018 House midterms and 2020 presidential election.

What do other learners have to say?

Devon

“I've used other sites, but DataCamp's been the one that I've stuck with.”

Devon Edwards Joseph

Lloyd's Banking Group

Louis

“DataCamp is the top resource I recommend for learning data science.”

Louis Maiden

Harvard Business School

Ronbowers

“DataCamp is by far my favorite website to learn from.”

Ronald Bowers

Decision Science Analytics @ USAA

G Elliott Morris
G Elliott Morris

Data Journalist

Elliott Morris is a data journalist who uses applied statistics and data science techniques with R to analyze, visualize, and model political (and other) data. Before he wrote articles and code professionally, he studied government, history, and computer science at the University of Texas at Austin. He shares his work frequently on Twitter (@gelliottmorris) and writes about data in politics at his blog, The Crosstab.

See More
Icon Icon Icon professional info