Perfoms an exact multinomial test on a vector of counts.
Usage
multinomial.test(x, p = rep(1/length(x), length(x)))
Arguments
x
numeric vector (counts).
p
theoretical proportions (optional).
Value
methodname of the test.
p.valuep-value.
data.namea character string giving the name(s) of the data.
observedthe observed counts.
expectedthe expected counts under the null hypothesis.
Details
The function works as chisq.test or G.test :
- if theoretical proportions are not given, equality of counts is tested
- if theoretical proportions are given, equality of counts to theoretical counts (given by theoretical proportions) is tested.
Since chi-squared and G tests are approximate tests, exact tests are preferable when the number of individuals is small (200 is a reasonable minimum).
Be aware that the calculation time increases with the number of individuals (i.e. the sum of x) and the number of groups (i.e. the length of x).
An exact multinomial test with two groups is strictly the same than an exact binomial test.