Description Usage Arguments Details Value Author(s) See Also

This function computes the p-value of a binomial test for frequency counts. In the two-sided case, a fast approximation is used that may be inaccurate for small samples.

1 2 | ```
binom.pval(k, n, p = 0.5,
alternative = c("two.sided", "less", "greater"))
``` |

`k` |
frequency of a type in the corpus (or an integer vector of frequencies) |

`n` |
number of tokens in the corpus, i.e. sample size (or an integer vector specifying the sizes of different samples) |

`p` |
null hypothesis, giving the assumed proportion of this type in the population (or a vector of proportions for different types and/or different populations) |

`alternative` |
a character string specifying the alternative
hypothesis; must be one of |

When `alternative`

is `two.sided`

, a fast approximation of the
two-sided p-value is used (multiplying the appropriate single-sided tail
probability by two), which may be inaccurate for small samples. Unlike
the exact algorithm of `binom.test`

, this implementation can
be applied to large frequencies and samples without a serious impact on
performance.

The p-value of a binomial test applied to the given data (or a vector of p-values).

Stefan Evert

corpora documentation built on May 19, 2017, 4:50 p.m.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.