Tuesday, 28 October 2014

National 2PP trend: 51.5 / 49.5 to the ALP

I've added some code to the repo that will calculate a two-party preferred estimate from the new model, using last election's statewide preference flows.

The current estimate of the national 2PP trend is 51.5 / 48.5 to the ALP:


This two party preferred trend is based on the State- and Territory-based primary vote estimates that are at the core of the model. The dots are pollsters' estimates of the national two-party preferred. (I've added them to the repo too, so you can replicate the graph yourself if you like.) The shaded area shows a 90% confidence interval. The most recent polls on the graph are a few days ahead of the last displayed point of the trend estimate, which is calculated weekly.

Monday, 27 October 2014

The New Model

I've been working on the new version of my poll aggregator for a while, and it's just about ready. The new model adds a bunch of improvements, and fixes some things that had been bugging me about the old one.

The new model is based on primary votes. Thomas McMahon passed on a whole bunch of polling data from the APH Library with primary vote numbers a few months ago, and that forms the basis for the new dataset. As a result, the model is able to track minor parties and carry out some more interesting election simulations.

Some other new things:
  • I've included the input data in the repo with the code, so the model is now 100% open source. You can access it via GitHub. The data is all in CSV files. To run the model, you'll need to install R, the open-source stats language.
  • The model now works on a weekly basis, which makes it easier to handle mixed-frequency data and polls that arrive on the same day.
  • Essential's polls are now directly modelled as weekly observations of a fortnightly moving average, and Morgan Multi polls are now recognised as fortnightly averages.
  • Newspoll's quarterly polls are directly modelled as quarterly averages.
Here's a sample of the new model's output, showing the recent history of Australia-wide polls. The blue is the Coalition, red is the ALP, green is the Greens, purple is Palmer United and yellow is Independents/Others. The turquoise-coloured dots are readings from pollsters who lump Palmer and Others together.
Using the last election's preference flows, the latest observations translate into a median outcome with the ALP winning 75 seats, enough to form a government with the support of Adam Bandt, who would have about an 80% chance of retaining his seat. (That's using the last election's preference flows at a State/Territory-average level.) I don't think the polls are precise enough to give much insight into the independent and KAP-held seats of Denison, Indi and Kennedy. Palmer United is down a few points from the last election, implying that Clive himself would struggle to retain Fairfax. So that would add up to 71 seats for the Coalition.

Friday, 24 October 2014

New model almost ready

The extended radio silence is because I've been working like a little pixie on the new version of the polling aggregator model. Should be ready..... pretty soon.