mymult: my multinomial function

View source: R/functions.R

mymultR Documentation

my multinomial function

Description

finds the number of successes in each iteration given an array of probabilities, 1 per option. The function adds the number of iterations that received each number of successes, divides by overall number of iterations, and represents the distribution as a percentage.

Usage

mymult(iter = 100, n = 10, p = c(1, 1, 1, 1)/4)

Arguments

iter

number of iterations

n

number of samples taken each iteration, with replacement

p

array of probabilities for each outcome, add to 1

Value

a barplot showing the relative frequencies and a corresponding table

Examples

mymult()


nbcastle/MATH4753cast0059 documentation built on May 3, 2022, 8:21 p.m.