Skip to content

EProportions · Guide test 074

One sample exact Poisson test

Tests a Poisson event rate against a target, accounting for exposure or observation time.

Runs in CodeSplashPython (calls R) example not runR example validated

Do it in CodeSplash

In the app, set it up in Analyze with this method:

Do it in CodeSplash Run this test on your own data, in Python or R.

Bench

Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.

Bench · One sample exact Poisson test

10
1.60
1.00

The rate H₀ claims.

0.050

Alternative

Your data

A count over an exposure
Events xExposure TRate x/T
20.00010.0002.000

20 events in 10 person-years

If H₀ were true

x = 20
  1. The reference: how x varies across samples when H₀ is true, Poisson(10.00).
  2. Your statistic, from the data above.
  3. The p-value: the total probability of outcomes no more likely than yours (p = .004).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

p=∑k: P(k)≤P(x)e−r0T(r0T)kk!p=\sum_{k:\,P(k)\le P(x)} \dfrac{e^{-r_0T}(r_0T)^k}{k!}

With your numbers

x=20,r0T=10,x/T=2x = 20,\qquad r_0T = 10,\qquad x/T = 2
xx
observed events
TT
exposure (person-time)
r0r_0
the rate H₀ claims

The verdict

x = 20, p = .004, x/T = 2.00

p ≤ α = .050: reject H₀

Effect size: observed rate x/T = 2.000

The Poisson analog of the exact binomial test; the two-sided p sums the counts no more likely than the observed one, as poisson.test.

Statistic
20.000
p-value
0.0040
One sample exact Poisson test on 20 events in 10 person-years: x = 20, p = .004, x/T = 2.00. The p-value is below α = .050, so the data are hard to reconcile with H0.

One sample exact Poisson test on 20 events in 10 person-years: x = 20, p = .004, x/T = 2.00. The p-value is below α = .050, so the data are hard to reconcile with H₀.

Question and hypotheses

H0: event rate λ=λ0.

Assumptions

A Poisson process/count model with known exposure t; independent events and a constant modeled rate.

Formula

X∼Poisson⁡(tλ0)P0(X=x)=e−tλ0(tλ0)x/x!\begin{gathered}X\sim\operatorname{Poisson}(t\lambda_0)\\[5pt] P_0(X=x)=e^{-t\lambda_0}(t\lambda_0)^x/x!\end{gathered}

Parameters and notation

x observed events,t exposure,λ0 target events per exposure unit.

Structure of the method

Map the target event rate and observed exposure to a null Poisson mean, then evaluate the observed count using an exact discrete tail rule. Rate confidence intervals arise by inversion of suitable Poisson tests; two-sided ordering must be stated because discreteness permits alternatives.

Estimated and nuisance parameters

The descriptive maximum-likelihood rate estimate is count divided by exposure. Under the simple null, exposure times the target rate fixes the full count distribution, leaving no rate nuisance to estimate. Exposure is assumed known rather than an uncertain measured covariate.

Settings and design choices

Choose exposure units, the target rate, directional versus two-sided inference, and confidence-interval convention in advance. Check that event definitions and at-risk time match across observations. The numerical rate target must change consistently if hours are converted into thousands of hours.

Fitting and adaptation

For a new observation period, recompute the expected null count using its actual exposure. A null simulation draws Poisson counts with that mean; there is no fine-tuning. Pooling periods is justified only when the assumed rate and event-count process support aggregation.

Sensitivity and robustness

A zero count is informative but does not establish a zero rate. Overdispersion, contagion, recurrent events within subjects, and changing hazards invalidate a simple Poisson count model. Uncertain exposure may require additional modeling rather than being treated as exact.

How to use and calibrate

Use an exact Poisson tail with a stated two sided convention and a compatible exact rate interval.

Example application

Test whether failures per 1000 operating hours exceed a specified rate.

Interpretation and pitfalls

Watch out

Clustering, overdispersion or changing risk can invalidate the Poisson model.

What changed in edition 2

  • New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.

Python and R

T is exposure, not necessarily sample size; tests rate .08 per exposure unit.

Python · invokes R

Not run — Executed end to end through Rscript · needs Python standard library + Rscript; R packages: base R

# Python launcher for the complete R implementation below.
# Requires Rscript on PATH and the listed R packages.
import shutil
import subprocess
rscript = shutil.which("Rscript")
if rscript is None:
    raise RuntimeError("Install R and make Rscript available on PATH.")
r_code = r"""
print(poisson.test(12,T=100,r=.08))
"""
# No shell interpolation. A failed R execution raises an error in Python.
result = subprocess.run([rscript, "--vanilla", "-"], input=r_code,
                        text=True, capture_output=True)
print(result.stdout)
if result.stderr:
    print(result.stderr)
result.check_returncode()
R

Validated — Executed successfully in the validation environment · needs Base/standard library

print(poisson.test(12,T=100,r=.08))
Output
	Exact Poisson test

data:  12 time base: 100
number of events = 12, time base = 100, p-value = 0.1543
alternative hypothesis: true event rate is not equal to 0.08
95 percent confidence interval:
 0.06200575 0.20961585
sample estimates:
event rate 
      0.12

Sources

Statistics guide v4 (historical):
Python: Executed end to end through Rscript · R: Executed successfully in the validation environment
Reference's record:
Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Python-to-R bridge; Rscript is unavailable. R code was not executed. Python: Not run in the reference's review: Python-to-R bridge; Rscript is unavailable. R code was not executed. R: Reviewed but not run: R wasn't available to the reference's authors.

From the CodeSplash statistics guide (v4), entry 074, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT074.