Description Usage Format Note Source References Examples
Aggregate data on the 24 elections to Australia's House of Representatives, 1949 to 2016.
A data frame with the following variables:
date of election, stored using the
numeric, number of seats in the House of Representatives
numeric, number of uncontested seats
numeric, number of seats won by the Australian Labor Party
numeric, number of seats won by the Liberal Party
numeric, number of seats won by the National Party (previously known as the Country Party)
numeric, number of seats won by other parties and/or independent candidates
numeric, percentage of first preference votes cast for Australian Labor Party candidates
numeric, percentage of the two-party preferred vote won by Australian Labor Party candidates
numeric, percent of first preference votes cast for Liberal Party candidates
numeric, percent of first preference votes cast for National Party (Country Party) candidates
numeric, percent of first preference votes cast for Democratic Labor Party candidates
numeric, percent of first preference votes cast for Australian Democrat candidates
numeric, percent of first preference votes cast for Green Party candidates
numeric, percent of first preference votes cast for candidates from Pauline Hanson's One Nation party
numeric, percent of first preference votes cast for Communist Party candidates
numeric, percent of first preference votes cast for Australia Party candidates
numeric, percent of ballots cast that are spoiled, blank, or otherwise uncountable (usually because of errors in enumerating preferences)
numeric, percent of enrolled voters recorded as having turned out to vote (Australia has compulsory voting)
The Liberal National Party of Queensland formed in 2008 after a merger of the Liberal Party and the National Party. In all elections following 2008, they have been categorised under
Australian Electoral Commission. http://www.aec.gov.au.
Jackman, Simon. 2009. Bayesian Analysis for the Social Sciences. Wiley: Hoboken, New Jersey. Example 3.5.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
data(AustralianElections) attach(AustralianElections) alpSeatShare <- ALPSeats/Seats alpVoteShare <- ALP2PP/100 ## log-odds transforms x <- log(alpVoteShare/(1-alpVoteShare)) y <- log(alpSeatShare/(1-alpSeatShare)) ols <- lm(y~x) ## Tufte-style seats-votes regression xseq <- seq(-4.5,4.5,length=500) yhat <- coef(ols) + coef(ols)*xseq yhat <- exp(yhat)/(1+exp(yhat)) xseq <- exp(xseq)/(1+exp(xseq)) ## seats vote curve plot(x=alpVoteShare, y=alpSeatShare, xlab="ALP Vote Share", ylab="ALP Seat Share") lines(xseq,yhat,lwd=2) abline(h=.5,lty=2) abline(v=.5,lty=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.