exactci-internal: Internal functions, not to be called directly

exactci-internalR 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), tsmethod = "minlike",midp=FALSE)
exactpoissonPval(x,T=1,r=1,relErr=1+1e-07,tsmethod="central")
exactpoissonPvals(x,T=1,r=1,relErr=1+1e-07,tsmethod="central")
exactbinomCI(x, n, tsmethod="minlike",conf.level=.95,tol=.00001,
    pRange=c(1e-10,1-1e-10))
exactpoissonCI(x, tsmethod="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

tsmethod

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

midp

logical, use mid-p for p-values?

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. To get p-values for the two-sample Poisson test save results from exactpoissonPlot. 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),tsmethod="minlike")

exactci documentation built on Aug. 24, 2023, 5:11 p.m.