Session Ready
Exercise

Exercise 1 - Comparing Proportions of Hits

In a previous exercise, we determined whether or not each poll predicted the correct winner for their state in the 2016 U.S. presidential election. Each poll was also assigned a grade by the poll aggregator. Now we're going to determine if polls rated A- made better predictions than polls rated C-.

In this exercise, filter the errors data for just polls with grades A- and C-. Calculate the proportion of times each grade of poll predicted the correct winner.

Instructions
100 XP
  • Filter errors for grades A- and C-.
  • Group the data by grade and hit.
  • Summarize the number of hits for each grade.
  • Generate a two-by-two table containing the number of hits and misses for each grade. Try using the spread function to generate this table.
  • Calculate the proportion of times each grade was correct.