Session Ready
Exercise

UKIP and Brexit

The relationship between a constituency's support for the Labour party and its share of voters who wanted to leave the European Union looked middling. Could there be a better explanatory variable?

Instructions
100 XP
  • Repeat the analysis form the previous exercise, but analyze the relationship between support for the UK Independence Party and Brexit vote.
  • Use the ggplot() function to graph ukip_2015 and leave_share on the x and y axes.
  • Add points for the observations in the brexit_results dataset using geom_point().
  • Add a line representing the line-of-best-fit between the two points using geom_smooth().