Description Usage Arguments Value Examples
Simulate a category assignment using a multinomial distribution
1 | sim_multinom(nsims, nreps, probs, names)
|
nsims |
Number of size=1 sims from the multinomial |
nreps |
Number of times to replicate the nsims. Put the smaller number here, the bigger one as nsims |
probs |
Vector of probabilities for each of the K categories |
names |
Vector of names associated with each of the categories. Must be of same length as probs. Can be character or numeric. Use numeric row IDs if you're referring to a group defined by multiple variables whose groupings are defined in a separate data frame |
Matrix of multinomial draws
1 2 | sim_multinom(10, 5, c(0.1, 0.3, 0.6), names=c('a', 'b', 'c'))
sim_multinom(5, 10, c(0.1, 0.3, 0.6), names=c('a', 'b', 'c'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.