View source: R/entry-probabilities.R
get_entryprobability | R Documentation |
Get probabilities to enter the parliament.
get_entryprobability(dirichlet.draws, hurdle = 0.05)
dirichlet.draws |
Matrix or data frame containing draws from
the posterior (see |
hurdle |
The percentage threshold which has to be reached by a party to enter the parliament. Any party called "ssw" will be exempt from the hurdle. |
Vector of (named) entry probabilities.
draw_from_posterior
library(coalitions)
library(dplyr)
# get the latest survey for a sample of German federal election polls
surveys <- get_latest(surveys_sample)
# use 100 simulations for a fast runtime
surveys <- surveys %>% mutate(draws = purrr::map(survey, draw_from_posterior, nsim = 100),
entryProbs = purrr::map(draws, get_entryprobability))
surveys$entryProbs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.