poisson.exact {exactci}R Documentation

Exact Poisson tests with Matching Confidence Intervals

Description

Performs an exact test of a simple null hypothesis about the rate parameter in Poisson distribution, or for the ratio between two rate parameters. This is different from poisson.test in that 3 different types of exact two-sided tests (and the matching confidence intervals) are offered. The one-sided tests are the same as in poisson.test.

Usage

poisson.exact(x, T = 1, r = 1,
    alternative = c("two.sided", "less", "greater"), tsmethod=c("central","minlike","blaker"),
    conf.level = 0.95, control=binomControl())

Arguments

x number of events. A vector of length one or two.
T time base for event count. A vector of length one or two.
r hypothesized rate or rate ratio
alternative indicates the alternative hypothesis and must be one of "two.sided", "greater" or "less". You can specify just the initial letter.
tsmethod character giving two-sided method, one of "central", "minlike" or "blaker", ignored if alternative not equal "two.sided"
conf.level confidence level for the returned confidence interval.
control list with settings to avoid problems with ties, etc, should not need to change this for normal use, see binomControl

Details

Confidence intervals are computed similarly to those of binom.exact in the one-sample case, in that there are three two-sided options depending on the tsmethod. For the one-sample case the default intervals use tsmethod="central" giving the Garwood (1936) exact central confidence intervals. For the two-sample case we condition on the total counts and then use binomial methods, see Lehmann and Romano (2005) for that motivation and vignette("exactci") for description of the three different two-sided methods for calculating p-values and confidence intervals.

Value

A list with class "htest" containing the following components:

statistic the number of events (in the first sample if there are two.)
parameter the corresponding expected count
p.value the p-value of the test.
conf.int a confidence interval for the rate or rate ratio.
estimate the estimated rate or rate ratio.
null.value the rate or rate ratio under the null, r.
alternative a character string describing the alternative hypothesis.
method the character string "Exact Poisson test" or "Comparison of Poisson rates" as appropriate.
data.name a character string giving the names of the data.

Note

The rate parameter in Poisson data is often given based on a “time on test” or similar quantity (person-years, population size). This is the role of the T argument.

References

Garwood, F (1936). Fiducial limits for the Poisson distribution. Biometrika, 437-442.

Lehmann, EL, and Romano, JP (2005). Testing Statistical Hypotheses, third edition. Springer:New York.

See Also

binom.test

Examples

### Suppose you have observed rates of  2 out of 17877 in group A 
### and 10 out of 20000 in group B
### poisson.test gives non-matching confidence intervals
### i.e., p-value using  'minlike' criteria but confidence interval using 'central' criteria
poisson.test(c(2,10),c(17877,20000))
### poisson.exact gives matching CI to the p-values
### defaults to 'central' two-sided method
poisson.exact(c(2,10),c(17877,20000))
### other options
poisson.exact(c(2,10),c(17877,20000),tsmethod="minlike")
poisson.exact(c(2,10),c(17877,20000),tsmethod="blaker")

[Package exactci version 1.0-0 Index]