Session Ready
Exercise

Polls in August and September

Remember the basic model we made to predict House election outcomes in Chapter 2? Beginning with this exercise, we're going to build off of that model, predicting November election outcomes with polls taken in August and September of the election year since 1980.

Instructions
100 XP
  • Filter the generic_ballot dataset to only include polls taken in August (8) and September (9) of the election year.
  • Create two variables called Dem.Poll.Margin and Dem.Vote.Margin to represent the Democratic margin in polls and the eventual election day vote.
  • Summarise this dataset so that it has the averaged Dem.Poll.Margin and Dem.Vote.Margin per year.