Description Usage Arguments Value Warning Examples
Calculate empirical quantiles from a sample created by sample_dirichlet
of a multinomial election poll
1 2 3 | sample_dirichlet_quantiles(vote = c(cdu = 0.5, spd = 0.4, fdp = 0.1),
sample_n = 1000, n_draw = 10000, show_mean = TRUE,
show_quantiles = c(0.05, 0.95), round = 2)
|
vote |
A labeled party vote share vector. |
sample_n |
The number of observations in the poll sample. |
n_draw |
How many samples to draw from the dirichlet distribution. |
show_mean |
Logical T/F: Show sample mean. |
show_quantiles |
Vector of quantiles/confidence boundaries to calculate. |
round |
Logical T/F Round Results to k decimal digits. |
A data frame containing n
rows of samples for each party.
Do not operate heavy machinery within 8 hours of using this function.
1 2 3 4 5 6 7 8 9 10 11 | sample_dirichlet_quantiles(vote = c(cdu = 0.33,
spd = 0.20,
fdp = 0.11,
linke = 0.09,
gruene = 0.09,
afd = 0.12,
sonstige = 0.05),
sample_n = 1000,
n_draw = 10000,
show_mean = TRUE,
show_quantiles = c(0.05,0.95))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.