| multinomial.test {RVAideMemoire} | R Documentation |
Exact multinomial test
Description
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). Can also be a factor; in that case |
p |
theoretical proportions (optional). |
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 as an exact binomial test.
Value
method |
name of the test. |
p.value |
p-value. |
data.name |
a character string giving the name(s) of the data. |
observed |
the observed counts. |
expected |
the expected counts under the null hypothesis. |
Author(s)
Maxime HERVE <maxime.herve@univ-rennes1.fr> based on multinomial.test
See Also
chisq.test, G.test, binom.test, multinomial.multcomp, multinomial.theo.multcomp
Examples
counts <- c(5,15,23)
multinomial.test(counts)