I want to understand the poisson.test() function:

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

I don't understand the parameters T, r and also what should be my alternative? I want to solve the following example and test the hypothesis that these data are Poisson.

A scientist counts the number of bacteria on a Petri dish. He knows that for a standard Petri dish N, the number of bacteria, follows a Poission distribution with parameter lambda=6.1. One dish is treated with a new bacteriacide and 2 bacteria are observed to survive.

Please can you help me understand the poisson.test with this example? What value of T I should use? What is the rate here? Which alternative shall I use?

  • 3
    $\begingroup$ Is this a question from a course or textbook? If so, please add the [self-study] tag & read its wiki. $\endgroup$ Jun 11, 2018 at 14:30

2 Answers 2


This is an R function that implements a hypothesis test for differences in means. It is analogous to the ?t.test function, except where that assumes the data are normally distributed (in the population), this assumes the data are counts from a Poisson. The basic idea is that you have two counts from two different conditions, where you know the distributions are Poisson. From there, you can test if the two counts differ by more than you would expect by chance alone. You only need one count per condition (perhaps surprisingly) because the Poisson distribution specifies the variance quite rigidly. If the population distributions aren't perfectly Poisson, the test will not be valid, so you are making a very large assumption that you can't assess. Nonetheless, the test may be useful on occasion.

With this basic framework in mind, we can interpret the arguments. x is a vector of two counts. If the counts arise from situations in which one condition has a greater opportunity for the event to occur, you can account for that via the T argument, which serves as an offset (cf., Should I use an offset for my Poisson GLM?). Imagine you compared the counts of bacteria from two Petri dishes, where one was twice the size of the other. The former might yield larger counts without anything going on (I don't know if it actually works this way). In that case, you would want to tell the test that the dishes differed; that's what T does. In addition, you could test against some value of the rate ratio other than unity, which is what r does. You can also do a one-sample test against a specified value of the rate; r allows for that, too. Lastly, you could test that your intervention differs from the control, which would be a 'two-sided test', or that the intervention yields larger counts ('greater than'), or smaller counts ('less than').

In your specific example, you say you want to "test the hypothesis that these data are Poisson". That would be a goodness of fit test, which isn't what poisson.test() does. It also doesn't match what the question is asking for.

The question, as stated, is asking if it's reasonable to get a value of 2 from a Poisson distribution with mean 6.1. That would be a one-sample version of the test implemented.


As @gung explained, your question is, if it is reasonable to get a value of 2 form a Poisson-distribution with $\lambda=6.1$. If not, the bacteriacide has reduced $\lambda$.

In R you can look up the probability density with the function dpois.

So the chance of getting zero from that distribution is

> dpois(x=0, lambda=6.1)
[1] 0.002242868

The chance of getting 1 is

> dpois(x=1, lambda=6.1)
[1] 0.01368149

And the chance of getting 0, 1 or 2 is

> sum(dpois(x=0:2, lambda=6.1))
[1] 0.05765291

Thus under the $H_0$ the chances of getting 2 or even less is larger then 0.05 which is the usual cutoff (note this is a one-sided test).

  • 1
    $\begingroup$ Note that this is [a manual version of] a one-tailed test. $\endgroup$ Jun 11, 2018 at 14:31
  • 1
    $\begingroup$ (I was holding off on providing code / a solution to the example problem, as this looks a bit like homework to me.) $\endgroup$ Jun 11, 2018 at 14:33
  • $\begingroup$ @gung That is a reasonable assumption, even w/o self-study tag, and I upvoted your answer before answering. However, I would not know how to answer the "Which alternative shall I use" part in a more self-study-manner.. $\endgroup$
    – Bernhard
    Jun 11, 2018 at 14:38
  • $\begingroup$ It is legitimately difficult, that's why I ended up holding off on that part for the time being. $\endgroup$ Jun 11, 2018 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.