## Saturday, November 5, 2016

### The post election count favours the Coalition

For the first time at the 2016 election, the Australian Electoral Commission has provided a two party preferred (TPP) count for each seat by vote type. This affords another window on the contention that the final count is more favourable to the Coalition when compared with the count of ordinary votes, which is completed on election night.

You can see the earlier analysis here and here, which came to the same conclusion over the past five Federal elections, based on the two candidate preferred (TCP) counts for each seat by vote type.

If we look at the Coalition's TPP percentages (summed across all seats, for each vote type) it received:

    Ordinary Votes:             49.952 %
Total Votes:                50.356 %

In the 2016 election, the Coalition lost the TPP count on election night (ordinary votes in the above list). But by the final count it had improved its position by 0.404 percentage points to win the final TPP count. The distribution of the Coalition's bias (compared with ordinary votes) across seats can be seen in the following charts.

The python code for the above analysis follows.

import pandas as pd
import numpy as np
from pandas import Series, DataFrame
import matplotlib.pyplot as plt
plt.style.use('../bin/markgraph.mplstyle')

# --- get data
header=1, index_col=None, quotechar='"',sep=',', na_values = ['na', '-', '.', ''])

# --- some useful frames

Coalition = 'Liberal/National Coalition'
Labor = 'Australian Labor Party'
Percent = 'Percentage'

# --- now let's calculate and plot the comparisons
year = 2016
print(year)

# check vote sums
Laborlist = (Labor + ' ' + pd.Series(vote_types[:-1])).tolist()
Coalitionlist = (Coalition + ' ' + pd.Series(vote_types[:-1])).tolist()

# let's focus on Coalition TPP only (and we will recalculate)
for x in vote_types[:-1]:
total = votes[Coalition + ' ' + x] + votes[Labor + ' ' + x]
votes[Coalition + ' ' + x + Percent] = votes[Coalition + ' '+ x] / total * 100.0
print(x + ': ', votes[Coalition + ' '+ x].sum() / total.sum() * 100.0, '%')

# and plot ...
types = (Coalition + ' ' + pd.Series(vote_types) + Percent).tolist()
for type, name in zip(types[1:],vote_names[1:]):
ax.set_title(str(year)+' Coalition TPP Bias in '+name+' cf Ordinary Votes')
ax.set_xlabel('Coalition bias in TPP percentage points')
ax.set_ylabel('Number of Seats')
ax.axvline(0, color='#999999', linewidth=0.5)

fig = ax.figure
plt.close()