Learn R Programming

combinat (version 0.0-4)

rmultinomial: Generate random samples from multinomial distributions

Description

rmultinomial: Generate random samples from multinomial distributions, where both n and p may vary among distributions rmultz2: fixed p case

Usage

rmultinomial(n, p, rows=max(c(length(n), nrow(p))))
rmultz2(n, p, draws=length(n))

Arguments

n
vector of sizes
p
vector or probs
draws
number samples required
rows

Value

    References

    ~put references to the literature/web site here ~

    Examples

    Run this code
    n <- c(100,20,10)
     p <- matrix(c(.3,.1,.5,.1,.1,.2,.6,.8,.3),3)
     rmultinomial(n,p)

    Run the code above in your browser using DataLab