exactci-internal {exactci}R Documentation

Internal functions, not to be called directly

Description

These functions give p-values for exact binomial or poisson test. Not to be called directly, use binom.exact or poisson.exact

Usage

exactbinomPvals(x, n, p, relErr = 1 + 10^(-7), method = "minlike")
exactpoissonPval(x,T=1,r=1,relErr=1+1e-07,method="central")
exactpoissonPvals(x,T=1,r=1,relErr=1+1e-07,method="central")
exactbinomCI(x, n, method="minlike",conf.level=.95,tol=.00001,
    pRange=c(1e-10,1-1e-10))
exactpoissonCI(x, method="minlike",conf.level=.95,tol=.00001,
    pRange=c(1e-10,1-1e-10))

Arguments

x number of successes or counts, vectors not allowed
n number at risk, vectors not allowed
p binomial parameter for null hypothesis, may be vector
relErr used in calculation to avoid ties, slightly bigger than 1
method two-sided method, one of "minlike", "blaker" ("central" only allowed for exactpoissonPval or exactpoissonPvals)
T number at risk or person-years at risk, vectors not allowed
r rate parameter for null hypothesis, null is E(x*T)=r, vectors only allowed for exactpoissonPvals
conf.level number between 0 and 1 for level of confidence interval
pRange range to search for confidence intervals, between 0 and 1 (even for poisson where it is transformed to a 0 to Inf-like range)
tol tolerance for precision of confidence interval, very small number

Details

The function exactbinomPvals tests point null hypotheses for a single binomial observation. The function exactpoissonPvals tests point null hypotheses for a single Poisson observation. The functions exactbinomCI and exactpoissonCI calculate the "minlike" and "blaker" confidence intervals.

Value

Returns either a confidence interval with attributes giving precision, or a pvalue (exactpoissonPval), or a list with pvals and parameters (r,T for poisson and p for binomial).

See Also

poisson.exact and binom.exact

Examples

exactbinomPvals(3,10,c(.3,.4,.5),method="minlike")

[Package exactci version 1.0-0 Index]