1. Learn
  2. /
  3. Courses
  4. /
  5. Hypothesis Testing in R

Connected

Exercise

Visualizing the difference

Before you start running hypothesis tests, it's a great idea to perform some exploratory data analysis. That is, calculating summary statistics and visualizing distributions.

Here, you'll look at the proportion of county-level votes for the Democratic candidate in 2012 and 2016, dem_votes_potus_12_16. Since the counties are the same in both years, these samples are paired. The columns containing the samples are dem_percent_12 and dem_percent_16.

dem_votes_potus_12_16 is available; dplyr and ggplot2 are loaded.

Instructions 1/3

undefined XP
    1
    2
    3
  • View the dem_votes_potus_12_16 dataset.
  • Mutate dem_votes_potus_12_16 to add a diff column containing the percentage of votes for the democratic candidate in 2012 minus the votes for the democratic candidate in 2016.