Overview

The coalitions package implements a Bayesian framework for the estimation of event probabilities in multi-party electoral systems (Bauer and others, 2019). To support estimation the package also implements scrappers that obtain data for German federal and general elections as well as Austrian general election. The implementation can be extended to support other elections.

# To install from CRAN use:
install.packages("coalitions")

# To install the most current version from GitHub use:
devtools::install_github("adibender/coalitions")

Usage

Detailed workflow is outlined in the workflow vignette.

A short overview is presented below.

Scrape surveys

The wrapper get_surveys() which takes no arguments, downloads all surveys currently available at wahlrecht and stores them in a nested tibble:

Each row represents a polling agency and each row in the surveys column again contains a nested tibble with survey results from different time-points:

surveys %>%
    filter(pollster == "allensbach") %>%
    unnest()
survey <- surveys %>% unnest() %>% slice(1)
survey %>% unnest()

References

Bauer, Alexander, Andreas Bender, André Klima, and Helmut Küchenhoff. 2019. “KOALA: A New Paradigm for Election Coverage.” AStA Advances in Statistical Analysis, June. https://doi.org/10.1007/s10182-019-00352-6.

Bender, Andreas, and Alexander Bauer. 2018. “Coalitions: Coalition Probabilities in Multi-Party Democracies,” March. https://doi.org/10.21105/joss.00606.