Computes the inclusive lower or upper tail probability of the observed run count under mutually independent Bernoulli trials with fixed, supplied success probabilities.
Usage
runs_tail(x, prob, tail = c("lower", "upper"))Arguments
- x
A non-empty logical or numeric vector containing only zeroes and ones. It is the observed binary sequence.
- prob
A numeric vector of the same length as
x. Itsith element is the success probability of theith trial and must lie in[0, 1].- tail
A character string selecting the inclusive
"lower"tail, \(P(R \le r_{obs})\), or inclusive"upper"tail, \(P(R \ge r_{obs})\). Partial matching followsmatch.arg().
Value
An object of class runs_exact_tail, a list with components
statistic, p.value, alternative, method, and probabilities.