View source: R/multinomial.test.R
| multinomial.test | R Documentation |
Perfoms an exact multinomial test on a vector of counts.
multinomial.test(x, p = rep(1/length(x), length(x)))
x |
numeric vector (counts). Can also be a factor; in that case |
p |
theoretical proportions (optional). |
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.
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. |
Maxime HERVE <maxime.herve@univ-rennes1.fr> based on multinomial.test
chisq.test, G.test, binom.test, multinomial.multcomp, multinomial.theo.multcomp
counts <- c(5,15,23)
multinomial.test(counts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.