Session Ready
Exercise

Who was "supposed" to win?

When election season comes around, analysts swarm over public opinion polls that may hold hints as to which way the winds blow. Since you have seen in chapter 2 that pre-election polls can be quite good at helping analysts foresee events in the United States, let's now look at how they do overseas.

This exercise is intended to provide you with a template to practice all the techniques you have learned so far: how to craft expectations, visualize outcomes, and analyze results.

Instructions
100 XP
  • Average all of the polls taken over the last week of the Brexit campaign in the brexit_polls dataframe.
  • Group and summarize this lead for polls on each day of the campaign, making sure that polls released on the same day get averaged together.
  • Visualize the trend line of Brexit polls with the ggplot2 package, passing the brexit_polls object to the function and adding a geom_point() for Remain's lead in each poll and add a trend line with geom_smooth(method='loess').