binomial_test {LocaTT}R Documentation

Binomial Test

Description

Performs binomial tests.

Usage

binomial_test(k, n, p, alternative = "greater")

Arguments

k

A numeric vector of the number of successes.

n

A numeric vector of the number of trials.

p

A numeric vector of the hypothesized probabilities of success.

alternative

A string specifying the alternative hypothesis. Must be "less" or "greater" (the default).

Details

Calls on the pbinom function in the stats package to perform vectorized binomial tests. Arguments are recycled as in pbinom. Only one-sided tests are supported, and only p-values are returned.

Value

A numeric vector of p-values from the binomial tests.

Examples

binomial_test(k=c(5,1,7,4),
              n=c(10,3,15,5),
              p=c(0.2,0.1,0.5,0.6),
              alternative="greater")

[Package LocaTT version 1.1.1 Index]