[Music]
right now a special pdns presenter
anthony green
anthony is a veritable national treasure
he's best known as chief election
analyst with the australian broadcasting
corporation and is the face of
television election coverages in
australia
during the pdns anthony will be
presenting election night analysis art
of science
and if we have anthony there i would
like to throw over to you
thank you miles now just make sure
everyone's hearing me good
um
election night analysis art or science
well the answer answered i'll answer
right at start the answer is science
um it's not guesswork it's not you know
hunches and feelings
it's hardcore maths and science
and
you know at that terrible moment when
it's looking really close and you're not
sure what's going to happen there's a
bit of experience and i've been here
before type thing the art the feeling
um but you know when it comes down to it
it's maths now
what the whole i'm not just start with
some credits first um
pictures in this presentation are all
from the australian electoral commission
have very useful flicker site pictures
the graphs have been prepared by me
a statistical credit for dr ross
cunningham who's an adjunct professor at
anu background in statistical analysis
and he developed many of the statistical
methods we used to analyze elections in
australia back in the 1980s when there
was a lot less computer power and a lot
less data my thanks to the abc who
originally hired me for six months as a
researcher my background was writing as
computer programmer back in the 80s and
then a background in political science
from study and so i was the right
combination of different skills when the
abc was looking for someone in 1989 and
30 years later they think i'm still
doing useful work
so
election night
it's about trying to work out
take what these people are writing on
their bits of paper
and turning into who's going to run
government for the next three years
that's what we're doing on election
night we're reporting all those bits of
paper added summed up sent through to us
when can we work out
who's won the election
now the long history of reporting
election nights in australia here's one
from wa um something that western
australia thinks was a terrible mistake
which was joining federation in those
days the media used to run these big
tally boards and they would report the
results like this people would come in
to watch results going up
that process eventually i mean in those
days
newspapers tend to have had big
telephony services more than the
government did
so that's why the newspapers used to use
do this sort of stuff they could get the
telegrams in quicker
than the government
by the 1990s this was the 1990 tally
room in canberra
huge great board with numbers on it
which people used to read the old
hardcore had been doing it for decades
would be down front looking at the
numbers and they could tell from four
digit numbers who was winning or not
something i've never been able to do i'm
afraid i have to use statistical
analysis
this is the back of the tally board in
2001 there's a bunch of names of the
candidates the same as on the front
these little boards have all got little
pins and they used to put little numbers
on them and then fit the board around
and that's what people used to read now
when i came into television we'd stopped
shooting the board it had just become a
big backdrop but
for another two decades after 1990 they
were still doing this board no one was
shooting it was of much less use it was
entirely done as a backdrop for
television
now australian federal elections
for those who don't know the election
process in australia that greatly quick
run through that
um you have two chambers elected on the
same day the house representatives in
the senate the house is elected from 151
single member districts the senate is
elected by proportional representation
from six states and two territories i
won't do anything on the senate tonight
each house division has about a hundred
thousand voters voting is compulsory
turnout is usually above ninety percent
around the country there's seven
thousand polling places plus five plus
pre-poll centers 400 plus mobile
voting
teams not trends and i've got my first
spelling error and all voting sentences
are counted on election night postals
and absent votes are after
added after election day
australia uses what's called
preferential voting or rank ordering
voting there's a ballot paper on the
right for the lecturer higgins i think
that's 2016.
voters must number all squares on that
ballot paper a consecutive sequence of
numbers
to win a candidate must receive fifty
percent of the vote
if no candidate receives more than fifty
percent of the vote then the lowest
candidate is excluded their ballot
papers re-examined for the next
available preference and the tally of
those preferences are transferred to
another candidate another candidate in
the account
all the preferences that are counted are
what is written on the ballot papers
there's no party control no candidate
control over that it's what voters write
on the ballot paper
the process of excluding and
transferring continues until only two
candidates remain and one of the
advantages in australia is we do come
down to only two candidates which makes
all the mathematics of the modeling much
easier than in many other countries and
the fact the full distribution of
preferences doesn't play take place till
two weeks after the election so up until
two weeks after the election when they
formed declare winners we're working off
preliminary figures especially on
election night now the process of
counting begins with this they tip the
ballot papers out of the boxes now
scrutineers are able to observe the
closing and the opening of the ballot
boxes
uh they're able to observe all this
process then they just tip these ballot
boxes onto the table or and that's when
the counting starts
the first thing they do on election
night is they count
each of them is counted on the night
after 6 pm
the tallying of first preferences by
candidate is done by hand it is not
scanned it is not the american
electronic voting it is not scanning a
ballot papers it is done by hand
candidates appoint scrutineers to
observe the count they are able to
observe the ceiling and the opening the
ballot boxes and they are able to
observe the count at all time and see
the ballot papers they're not allowed to
touch the ballot papers but they are
able to challenge votes though on
election night they're more trying to
look at preference flows
and get the tallies for their own
internal purposes as a political party
the number of ballot papers also varied
against verified against the number of
ballot papers issued and then once this
is all done the numbers are phoned
through
to wherever the data entry operates for
the electoral commissioner and the
tallies for that polling place are
entered so this is how the process
occurs it's done the old-fashioned way
bits of ballot paper put onto piles
and at the end of that process
they have a whole bunch of bundles of
votes usually all bundled up into lumps
of 100
so they've got a tally of first
preferences in every polling place and
that's phone through
what they've done now in australia since
1993 and thankfully i didn't work before
then because this would have been much
harder
is they do what's called an indicative
preference count
beforehand the electoral commission
nominates
um
two candidates in every contest who will
be the final pairing so they don't do
the full distribution of preferences
what they do is they nominate two
candidates at the start
they're in an envelope they open them so
they know this after 6pm this is you
can't know this information before 6pm
it's only an indicative count so it's
not important for anybody else to know
then they examine all the bundles of
ballot papers for the other candidates
they go through all those and they work
out from that list of candidates which
of the final two gets the
lower numbered preference on that ballot
paper which candidate receives the
preference from that ballot paper they
tally all those preference flows for
each candidate they add them to the
first preference votes for the two final
two candidates and then they phone those
numbers through so from each polling
place and each pre-poll center on
election night we get two totals the
first one is that first preference tally
and the second one
is the is the two-party preferred or two
candidate preferred two-party preferred
tends to prefer labor versus the
coalition the two major parties
sometimes the major part is excluded and
we have what's called two candidate
preferred in the end it all comes down
to two candidates in every seat and it's
worked out beforehand who in the most
likely final two for this count if they
get account wrong they do it again after
the election but this is just done for
extra information to help us understand
this came about after 1990 federal
election when there's a huge vote for
the democrats nobody had preference
counts and it was unclear who'd won so
they introduced this process for the
future and as the proportion of vote
that's gone to minor parties has
increased this has become ever more
important
what happens then is these numbers are
phone through
data entered into the ac's computer
system transmitted to their central
server put in a database and that runs
the aec's virtual tally room if you've
used it online
there's also an xml strip published
every two minutes of all the data
so it's a total for every candidate in
every electorate
both first preference and two candidate
preferred and those first preferences
and two candidate also reported by
polling place so we have this whacking
great file with all that information in
there there's various versions of it
there's what's called the both versions
which have all the strings like names
and these other ones that just have the
votes
the files also contain historical data
for each polling place and for each
candidate and that is made available to
the to the media as well beforehand but
you can use it directly from the xml
file if you don't have a database but
for for various reasons we in the media
prefer to have the data in our own
system and or do our own calculations
the abc computer is pre-loaded with all
the electorates and candidate details
polling place details including history
estimated preference formulas that can
be used until actual preference counts
received
and where we judge the aacs pick the
wrong pairing of candidates
as well as calculation information the
data blaze space includes attributes
that determine party colors ordering
details for graphics for online and for
picture names the abc's database
provides the structure through which
we're able to analyze the data we're
just getting raw data we have to have
our own structure which we use to
analyze the data and aggregate the data
now the abc passes the aec data file
strips out the results by polling place
an electorate and stores in our system
we check it for obvious calculation
errors and then our abc computer
performs its predictive calculations on
all seats and every up after every
update and after any internal parameters
change the computer also generates json
output which is used for television
graphics and for publishing our abc
online system now i'm going to turn our
camera off because we've been um we've
having some camera problems but i'll
continue with the the slide presentation
um
now
let's call this camera
now
post election counting um
this is
after election night so this is i'm
raising these issues just because people
always have doubts of how the election
accounting works and stuff this is just
to tell you that the system has lots of
other checks in all votes counted on
election night are transferred overnight
to the returning officer for the
district
all first preference and two candidate
tallies are check counted over several
days the account conducted by different
staff and again watched by scrutineers
not necessarily the same ones that
washed on the night the indicative
preference counts are redone
and they're redone entirely if the wrong
candidates were chosen postals absence
and provisionals are added up added over
for over fortnight after the election
after a fortnight a full distribution of
preferences is done which is effectively
a third count of all non food of all
votes for minor parties and if not
already done a formal win it is declared
at this point
now
just to explain how we've got to this
point over the years
the ac's first computers uh started to
use them in 1980s we had to be in the
tally room to get the data by exonic
soft feed
um they began to add historical data to
the feed in 1990 um preference counts
were added in 1993 they switched to xml
as the export format rather than the old
feed
published to an ftp site
in the mid 2000s the last physical room
tally room was in 20 2010.
the abc had originally a pdp-11 system
when i started it was turned into a pc
network running unix later linux
um
it was a memory map it you know there
was um written in c first gui interface
was 2008 uh it was rewritten in dot net
c plus plus in about 2010
and most recently last year was
rewritten to run on an amazon server um
with various other bits and pieces
so it's been a long history of changes
which has been sort of mirroring the way
the internet has changed largely
now
election night the statistical problem
let me start with a basic statistics
question if you have a large bag full of
a thousand black and white ping pong
balls the balls have been thoroughly
mixed what size sample do you need to
draw to be certain of the ratio of
blacks and white balls now the election
night question is similar at 6 pm on
election night each electorate has 100
000 ballot papers sealed in ballot boxes
and envelopes how many have to be
counted and reported before we can be
certain of the ratio of labor to liberal
votes now the two problems are the same
except with election night we have to
take steps to account for the samples
not being random
we also have the advantage that the
figures are progressive so each update
is a larger sample of effectively but
it's a cluster sample not a random
sample
but we do have the advantage of these
clusters we know what the voting was in
them was last time so it's the same
basic statistics with a whole bunch of
statistical methods to try and overcome
the fact
that um you have to account for the data
not being random
now predicting every electorate
um
every every electorate will finish with
a final value p which is the winning
candidate's proportion of all votes we
often call this two-party preferred or
two candidate preferred and we express
it as a percentage 55
to candidate preferred at all times in
the count we have a point estimate a
little p and that's our current estimate
of the final result
now our techniques are to minimize
statistical bias
that is things that make p an unreliable
estimator
and we also want to use methods that
minimize the amount of variance the
amount of variability the amount of
moving up and down that the graphs will
do
and all points in the count at all
points in account we construct a
confidence interval for p having
minimized bias and variance
and calculate the probability that p is
greater than 50 percent and if it's
greater than 50 percent with a 99
probability we make the binary solution
to give it one side or the other
and the overall result of the election
is just simply the sum of the
probabilities in individual seats with
an error margin so this sounds
all the effort goes into the individual
seat results not into the overall
prediction the overall prediction just
falls out of the mathematics in each
seat
now we have a number of underlying
assumptions one is that it tends to be a
uniform swing
from polling place to polling place and
as i'll show in a while there is there
you can make that assumption
and um
we also assume most people vote the same
election as last time though that's
begun to change in recent years with the
increase in pre-poll voting
just to comment
comparing with the us we have much
higher quality data here we have a much
simpler issue because we have a two
candidate contest in the u.s you haven't
try and predict when the gap between the
two candidates stabilizes we can work on
this figure of being over 50
um
now what are the sources of error
that we've got here we've got bias
in elections that mainly many rural and
especially mixed rural urban seats
display a strong positive correlation
between booth size and labor two-party
preferred vote small rural polling
places record lower labor vote than
large urban ones now this matters
because small polling places are quicker
to count and first the report and
therefore there's a resultant labor vote
low labor vote early in the evening
which is statistical bias in in terms of
our point estimator one thing i'll say
about this was um if you're familiar
with the plate don's party that all
began with labor vote high and falling
through the night that used to happen
before 1987 in 1987 they introduced the
change so that all polling places
counted at the start of the night before
then because of lack of phones and the
things a lot of country polling places
were brought to town before they were
counted and that meant the labor vote
was high and fell through the night 1987
was the first election where that trend
reversed and that caused a lot of
embarrassment for a lot of people who
went on past trends and said that john
howard had won the 87 election
which he didn't
now the other thing is variance past
results can be used to calculate a range
of variance of polling place results in
each c seats with lower variance can be
given away more quickly
and and we also aim to adopt a
statistical method
where
the variance of the vote the variance is
smaller
and that's happens to be with swing
rather than vote so rather than using
the vote the current vote to predict the
result
we use the change in vote
from the same polling place as last time
as a way i'll explain in a moment the
americans always do this as statics they
start they report the numbers report the
numbers we in australia report the swing
and show the projected value and it's
much more reliable and it's why
um you'll have that bloke running the
screens in the united states talking
about well the democrats are ahead but
when this area comes in the panel handle
of florida comes in the republicans will
lead we don't have to talk about numbers
here because we do that projection in
how we present our data now to explain
how all this works i'll move on to the
example of an electorate
and
this is the electorate of braddon
in tasmania
just let me find my notes because i had
a bit of scurrying around there for a
few minutes
brandon's up in the northwest of
tasmania you can see it's a it's got a
lot of blue dots a few red dots
it's uh traditional swings cedar swung
changed parties six of the last election
eight elections a lot of big urban
booths a lot of small
country booths which have strong liberal
votes and a smaller number of small
labor boos on the west coast form a
mining town so this is a uh this is a an
electorate where you want to know what
the data is like and where it's from
this is a scatter plot from the 2019
election the the grey dots are the
two-party preferreds
um for each uh
each polling place now the yellow area
is the two standard
standard error confidence interval
ninety-five percent confidence interval
the variance on these polling places is
eight point nine percent so two standard
areas there's a seventeen percent range
of results to have ninety-five percent
of the polling places now i'll show you
the two attributes with my mouse the
first is you'll notice there's a bigger
variance at the start and that's because
a lot more small polling places small
polling places are usually from small
towns which are more homogenous than
larger urban centers so there's a bit
more variance particularly in a seat
like this you'll also notice there's
some bias there's a lot more of these
dots above the 53.1 which was the final
result of the election so on those early
figures if the small birds come in first
you're going to have a lot more
variability
you're also getting a lot of bias
because there's a lot more liberal votes
there in those early figures so if i go
on to the next graph this graph is
the same dots it's the biggest scale but
it's the same dots and over it i've
superimposed
the progressive two candidate preferred
two-party preferred from those polling
places as they come in and as you can
see
in this area here there's a lot of
variability it bounces around it's also
biased towards the liberal party which
is the area above 50
so for quite a long while and these
these graphs are in
in polling place size order i've
arranged them from smallest to largest
which is not how it comes in i'll show
you another example later but this is
the worst case scenario and it takes a
long time for this figure to settle down
uh just let me consult my notes if
there's anything else i've got to stay
here
no that's why that's the key thing that
you've always got to watch for is this
early figure now
this next graph actually i'll stay on
this graph um
dr ross cunningham back in the 80s
worked out a method to correct for this
bias if you looked at the every one of
these electrodes has a characteristic
curve like that
he went away and he worked out what's
called a bias corrective method he he
plotted what that characteristic curve
normally looked back like and corrected
for it he then built in for many seats
and built in an overall regression model
to pick the winner he was less concerned
about picking individual seats than
correcting for bias for an overall
regression model to pick the winner of
the election we've we've adapted his
model to be more about picking
individual seats and for the newer
methods which are now available we don't
need to do we're not as reliant on
regression now
this is the same data from 2019 and
against it i've plotted the progressive
numbers
for 2016 which is the green line at the
bottom
it's the same data
now
what you can see here is if you can know
what that graph is going to look like
from last time you can plot where this
regression's gone where this figure is
going to end up there's a very good
match between those two numbers uh that
we're seeing here
let me get my graphs yes um if you look
at the gap between the two lines you can
see that this this gap is stable
if you know where this green line is
going you know where the black line is
going and that's that's
um that's the method we use to call the
election now the other thing that's to
say
is the gap between the two lines is the
swing
it's the change of vote at every point
on that graph you've got a current total
and you've got a historical total of the
same figures that difference in between
the two numbers is the swing and this
graph shows the gap between those two
lines doesn't have a lot of variability
it has a lot less variability
than the
the the first preference line and that
can be seen
let me look now
so so let me i'll come back to how we
use this but the key point to make is
that gap
is the swing and if you can you rely on
the swing you've got something really
useful to use now this next graph
this is the um graph of the swings by
polling place again arranged by um
by polling place size but just let me go
back this has got the same range on the
y-axis of 60
if i go back to that previous one
there's a huge
um 34 point range in the variance and
the the dots are all over the place
the swing from polling place to polling
place it doesn't have this it has a
little bit of a cluster at the start but
it's not biased it's not above or below
in any particular order so we've got
here something which doesn't have an
early bias and has only got half of the
standard deviation so you've got a more
reliable estimator to use if you can
operate on the swing and that's what we
do the simple two candidate preferred
which was that first black line
is just the current total and the method
has the problem that the bias and the
large variance is built into that number
the simple swing is the current 2cp
minus the final 2cp from last time
but because the 2cp you're using is bias
both the swing and the 2cp are going to
be biased and have various problems in
the same manner what we do is what's
called a match two candidate preferred
analysis which uses the unbiased and low
variance polling place swings
at every point on the count
our current count compares the current
2cp to this historical 2cp subtracts one
from the other and gets a match to swing
which that match swing is the gap
between those two graphs i showed you a
moment ago and then what you do with
that match swing
is you ask add that swing to the two
candidate preferred for the last
election
and what you get on this next graph the
black graph is the same as on the
previous chart but the red graph is is
prediction based on the red based on the
matte swing
and this is what you get there's that
black line which takes it to about 30 to
settle down this is the red line this is
the match figure this is stable this
isn't bouncing around this is like 10 of
the counted and within one percent of
the final result
the low variance and the lack of bias
means that this is an accurate predictor
and it's why
we that's the method we use we use this
comparative swing and that removes
nearly all the bias and a lot of
variance from the early figures
now
this is actually the same graph
but what i've done here is i've actually
used the time stamped data from the last
election so this isn't on the order of
polling places it's on timestamp now
this performs slightly better so the the
black line took to about 30 percent to
settle down on the other graph using
real-life data it's settling down about
20 percent but the key point is the the
red light is still it's just way more
stable and this is the same in every
election the swing is always more stable
than the the two candidates essentially
there is a wide range of results from
polling place to polling place and if
you want to use the raw numbers
you've got all that wide range
if you use the swing you're measuring
change from the last election and that
change will always be less than the two
than the two candidate preferred
variability in an individual electorate
two candidate preferred right results
can range from 20 to 80 percent you know
they have a huge range
swings will be clustered around the
swing and they're going to be a lot
smaller and the variance on average is
between one-third just through the
standard deviation between one-third and
half and that's why we operate on the
swing now
on election night this is the way the
data comes to us the blue line is first
preferences
and the second line is the two-party
preferred which comes in later or two
candidates preferred you can see that
one lags the other and then they catch
up later in the evening the key thing to
watch for is 7 p.m i've only got 10
less than 10 of the first preference
felt only about three percent of the
two-party preferred by 7 30 i've got to
10 two-party preferred and
remember i mean this this is 10 this but
we haven't got the data in that order
we've got it in time order so this is
what the next graph is what the graph
looks like if i plot this by time
and you've got the graph is much further
over to the right we're spending a lot
more time earlier in the evening at 7 30
in the evening talking about early
figures because we haven't got a lot 10
percent of the two-party preferred
candidate but
the key point to make there is this is
more stable
than the the number up here and that's
what i want at 7 30 i want to know what
the numbers are and i always say at 7 30
on the night i usually know the result
of the election if it's clear
if i don't know the result i know we
have to wait for more data you know if
you ever know the result by 7 30 you
might know it later if it's a really
close election you won't know the
results on the night
but that's
that's essentially what i'm doing on
election night so
what do we do next we've got that curve
what do i do it's this red curve that's
the line i showed earlier the dotted
lines on either side that's the 99
confidence interval once that confidence
interval is above 50
i'm confident that my prediction
is over 50
it is not going to fall back onto the
other side it might bob back and
forwards but it's not going to disappear
this is the figure that i want to use i
want something which gives me a stable
prediction very early and so that's the
method to use now i've got two vertical
lines there
because you do get variability in early
figures we have two cutoffs
three percent is we have a bottom of
frame total on television no seat is
included in that figure so i've got
three percent counted that just
minimizes the number of times the seats
go down and that always makes people
worried when the tally goes down now
they say how can you have given the seat
away and then take it back
well if you're doing it by hand in
absolute confidence you would be more
cautious we have automated this so it
will sometimes go down
but the alternative is you do it
manually and you get updates every two
minutes and you're constantly behind if
you adopt this statistical method you
will always be up with the data and so
that's what we choose to do now just a
hint on this next graph because i'm not
showing giving away too many secrets um
this explains how this two-party
preferred looks like if you plot the
confidence interval um basically and
this is not brandon this is an entirely
different electorate and i've removed
all the numbers so you can't read it but
basically that confidence interval
interval turns into a downward sloping
downward curving line
which approaches
the the it's asymptotic the line
approaches the 50 line
when you get to um all the votes counted
once that red line crosses that we give
the seat away now the seat might drop
back
it generally drops back into leaning
that way as you can see that that never
dropped below 50 percent
there's no way that that's once it gets
close to that line it is not suddenly
going to revert to the other side of 50
and you've got a a reflective curve for
the other candidate in the final race so
that's that's what that confidence
interval looks like i've not shown you
because otherwise people sit and figure
out you know a pseudo version of what we
do and i'm just not going to do that but
that's what you end up with and out of
all this comes this box which is from
the south australian election this gives
me
the um
the number of seats won by each party
and that's the whole game that we're
doing here and on these numbers from
quite early on we've got the liberal
party on 25 seats
and i have an error margin plus or minus
three seats you need 23 seats for
majority if i'm looking at these numbers
on the night that's not close enough to
call but this looks like magic this
looks like this is all under so you know
i'm sort of making a guess or something
all the mathematics in each of those
seats is being done constantly and it's
being checked and we have alternatives
for the preference formulas are wrong we
have different ways we can if we think
the formula is over predicting we can
pull the seat back into doubt um i don't
manually give seats away i will manually
push them into wind out if i want to but
that all then produces this total at the
end so everyone thinks i'm you know
making some guess or not i'm not it's a
science this is all science all
mathematics and that's the way it's done
so um that's my little presentation but
uh as i said
if i go back to this graph
um this is the magic if you use the
swing
you get a red line prediction like that
which is stable from very early on if
you use the black line
um
you're all over the place waiting for
the figures to stabilize and i'll say
one further thing
it is getting slightly harder at the
moment the rise in pre-poll voting and
postals the assumption that people vote
in the same place as last time is
starting to be undermined and we've i
know we did the queensland election
there was a huge increase in pre-polar
and postal voting it was a closer
election we just had to wait longer and
in fact in recent years we've begun to
sort of wind out the variance formula so
that the system gives a little bit more
wiggle room in the predictions
so anyway that's that's my presentation
you for that anthony that was really
really interesting i do like the
statistical magic you've pulled off
there it is quite incredible
thank you very much
so hopefully you'll be you'll be quite
busy for the um the first half of this
year i imagine anthony you'll be yes i
have a um south australian election on
the 19th of march
and it's looking pretty clear that the
federal election will be in may not
march at the moment so that's my working
assumption of course it could be wrong
but that's my working assumption
yes yes so you know who can predict
these
these politicians what would they do