Learn R Programming

RVAideMemoire (version 0.9-83-7)

multinomial.test: 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)))

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.

Arguments

x

numeric vector (counts). Can also be a factor; in that case table(x) is used as counts.

p

theoretical proportions (optional).

Author

Maxime HERVE <maxime.herve@univ-rennes1.fr> based on multinomial.test

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.

See Also

chisq.test, G.test, binom.test, multinomial.multcomp, multinomial.theo.multcomp

Examples

Run this code
counts <- c(5,15,23)
multinomial.test(counts)

Run the code above in your browser using DataLab