These functions give p-values for exact binomial or poisson test. Not to be called directly, use binom.exact
or
poisson.exact
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))
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).
number of successes or counts, vectors not allowed
number at risk, vectors not allowed
binomial parameter for null hypothesis, may be vector
used in calculation to avoid ties, slightly bigger than 1
two-sided method, one of "minlike", "blaker" ("central" only allowed for exactpoissonPval
or exactpoissonPvals
)
number at risk or person-years at risk, vectors not allowed
rate parameter for null hypothesis, null is E(x*T)=r, vectors only allowed for exactpoissonPvals
number between 0 and 1 for level of confidence interval
range to search for confidence intervals, between 0 and 1 (even for poisson where it is transformed to a 0 to Inf-like range)
tolerance for precision of confidence interval, very small number
logical, use mid-p for p-values?
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.
poisson.exact
and binom.exact
exactbinomPvals(3,10,c(.3,.4,.5),tsmethod="minlike")
Run the code above in your browser using DataLab