Diagnostic
Andreas Bender
2020-02-05
## Warning: 1 failed to parse.
## Warning: 1 failed to parse.
temp <- temp %>%
mutate(
respondents = 1000L,
percent = c(36, 28, 7, 6, 9, 9, 5),
votes = respondents * percent/100) %>%
nest(survey = party:votes)
set.seed(29072017)
draws <- map(temp$survey, draw_from_posterior, nsim=1e4, correction=0.01) %>%
flatten_df()
draws_long <- gather(draws, party, percent, cdu:others) %>%
group_by(party) %>%
mutate(sim = row_number()) %>% ungroup()


## # A tibble: 7 x 2
## party entryprob
## <chr> <dbl>
## 1 afd 1
## 2 cdu 1
## 3 fdp 0.868
## 4 greens 0.988
## 5 left 1
## 6 others 0.500
## 7 spd 1