Session Ready
Exercise

Fitting a model to past polls and results

If we want to be able to make inferences about an election before it happens statistics offers us a more powerful tool than a simple average of polls this year: linear regression. Regression models simply analyze the relationship between two variables, allowing us to predict the value of variable A given the value of variable B. Here' we're going to fit a model for linear regression to predict past election day vote outcomes given the polling margins in those years.

Instructions
100 XP
  • Fit a model to predict the Dem.Vote.Margin in a given year with the average Dem.Poll.Margin in polls taken that cycle, then explore the results of the model.