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 as an exact binomial test.