sim_multinom: Simulate a category assignment using a multinomial...

Description Usage Arguments Value Examples

Description

Simulate a category assignment using a multinomial distribution

Usage

1
sim_multinom(nsims, nreps, probs, names)

Arguments

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

Value

Matrix of multinomial draws

Examples

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'))

cancerpolicy/bcimodel documentation built on June 30, 2019, 12:39 a.m.