EProportions · Guide test 074
One sample exact Poisson test
Tests a Poisson event rate against a target, accounting for exposure or observation time.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Poisson rates (one rate or two rates compared) — Is an event rate (events per unit of exposure) different from a reference value or between two groups?
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
The rate H₀ claims.
Alternative
Your data
A count over an exposure| Events x | Exposure T | Rate x/T |
|---|---|---|
| 20.000 | 10.000 | 2.000 |
20 events in 10 person-years
If H₀ were true
- The reference: how x varies across samples when H₀ is true, Poisson(10.00).
- Your statistic, from the data above.
- The p-value: the total probability of outcomes no more likely than yours (p = .004).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- observed events
- exposure (person-time)
- 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 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
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.
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()
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.12Sources
- R stats — R stats · poisson.teststat.ethz.ch
- poisson.teststat.ethz.ch
- 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.