poisson.test {stats} R Documentation

## Exact Poisson tests

### 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.

### Usage

```poisson.test(x, T = 1, r = 1,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95)
```

### 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. `conf.level` confidence level for the returned confidence interval.

### Details

Confidence intervals are computed similarly to those of `binom.test` in the one-sample case, and using `binom.test` in the two sample case.

### 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, or expected number of cases from mortality tables). This is the role of the `T` argument.

The one-sample case is effectively the binomial test with a very large `n`. The two sample case is converted to a binomial test by conditioning on the total event count, and the rate ratio is directly related to the odds in that binomial distribution.

`binom.test`

### Examples

```### These are paraphrased from data sets in the ISwR package

## SMR, Welsh Nickel workers
poisson.test(137, 24.19893)

## eba1977, compare Fredericia to other three cities for ages 55-59
poisson.test(c(11, 6+8+7), c(800, 1083+1050+878))
```

[Package stats version 4.1.2 Index]
{"ft_lang_label":"__label__en","ft_lang_prob":0.7458591,"math_prob":0.9300163,"size":1975,"snap":"2022-05-2022-21","text_gpt3_token_len":495,"char_repetition_ratio":0.11466261,"word_repetition_ratio":0.03021148,"special_character_ratio":0.2556962,"punctuation_ratio":0.13385826,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99715155,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-27T22:43:42Z\",\"WARC-Record-ID\":\"<urn:uuid:99d96102-ca5b-412b-b19a-27ff68029274>\",\"Content-Length\":\"4739\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:4a8bef27-7e52-4af7-be07-0364f654f06d>\",\"WARC-Concurrent-To\":\"<urn:uuid:c15fffcd-a829-4cb6-a0ca-65b5120a527c>\",\"WARC-IP-Address\":\"129.132.119.195\",\"WARC-Target-URI\":\"https://stat.ethz.ch/R-manual/R-patched/library/stats/html/poisson.test.html\",\"WARC-Payload-Digest\":\"sha1:BEQ3CNAF33SQUMYVZWMMC4MZMEYBLVKH\",\"WARC-Block-Digest\":\"sha1:WXDR4T3TDWGUZ3ASS3TTQMUR4HLGG4OM\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652663006341.98_warc_CC-MAIN-20220527205437-20220527235437-00684.warc.gz\"}"}