j3camero / canada-election-forecast

Code that forecasts the results for each electoral district (riding) in the Canadian 2015 federal election
Apache License 2.0
28 stars 2 forks source link

readme, source/stats on data #12

Open ebuchman opened 8 years ago

ebuchman commented 8 years ago

this is fantastic.

I'm wondering if you wouldn't mind preparing a simple README so I can replicate locally.

Would also like to know where the data is from, what the sample sizes are and the estimated margins of error.

Thanks!

j3camero commented 8 years ago

That's a great idea, especially now that more folks are looking at the internals of the model. For now, you can run the projections using the following command line:

git clone https://github.com/j3camero/canada-election-forecast cd canada-election-forecast python riding_forecast.py > riding_forecasts.csv

In the CSV file you'll find the computed stats for each riding, including the numbers that appear on the website. You don't need any special input files, all the inputs to the model are in the repo and version controlled to ensure reproducibility and accountability.

I've got an update coming that will make it much clearer exactly which polling data is being used and how. For now, you can find in the file regional_polling_averages.csv the regional polling data that presently feeds the model. After the upgrade, the model will instead be fed by this Wikipedia page:

https://en.wikipedia.org/wiki/Opinion_polling_in_the_Canadian_federal_election,_2015_by_constituency

There you have links to the individual polls, methodology, sample sizes, etc.