Description Usage Arguments Value Warning Examples
Calculate a dirichlet-sample of a multinomial election poll
1 2 | sample_dirichlet(vote = c(cdu = 0.5, spd = 0.4, fdp = 0.1),
sample_n = 1000, n_draw = 10000)
|
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. |
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 | sample_dirichlet(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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.