Explore

Rates over exposure: the Poisson rate ratio

H₀: RR = 1 · H₁: RR ≠ 1

z = -8.0536 · p = 8.04E-16

p = 8.04E-16 ≤ α = 0.05: reject H₀. Group 1's rate is 0.7891 times group 2's, further from 1 than chance alone would easily take it; the interval, [0.7448, 0.836], gives the range of ratios that fit the data.

How to read the picture

  • For the score and Wald tests the curve is the null world of z; for the exact test the bars are the binomial distribution of group 1's share of all the events.

  • The vertical line is your result; the shaded area or the highlighted bars are the p-value.

  • Below, the rate ratio with its interval, against 1 (no difference) and the null ratio you set.

Your data

y₁ = 2062

y₁ (events in group 1)
T₁ (exposure of group 1)

y₂ = 2601

y₂ (events in group 2)
T₂ (exposure of group 2)

Rate = 1

Rate ratio under H₀

Method

Alternative hypothesis

Significance level α

When events are counted over time in service, the fair comparison is the rate: events per unit of exposure. Meridian's telematics policies had 2,062 claims in 23,672 vehicle-years; the standard ones 2,601 in 23,561. The rate ratio compares the two, and the test asks whether it differs from 1, or from any ratio you set, such as 0.9 for 'at least a 10 % reduction'.

The estimate and what the data show

The estimate with its interval Rate ratio: 0.789 [0.745, 0.836]. no difference. no differenceRate ratio 0.789 [0.745, 0.836] 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05rate ratio (group 1 / group 2)
A rate over exposure assumes events happen independently at a steady rate (a Poisson process); claims that cluster make the interval too narrow.

The worked steps

  1. The two rates

    y₁ / T₁ = 2062 / 23671.791 = 0.08711 · y₂ / T₂ = 2601 / 23560.917 = 0.1104
  2. The rate ratio

    RR = 0.08711 / 0.1104 = 0.7891
  3. The count ratio H₀ expects

    r = RR₀ × T₁ / T₂ = 1 × 23671.791 / 23560.917 = 1.0047
  4. The score statistic

    z = (y₁ − r y₂) / √((y₁ + y₂) r) = (2062 − 1.0047 × 2601) / √(4663 × 1.0047) = -8.0536
  5. The p-value

    p = 2 × P(Z ≥ |-8.0536|) = 8.04E-16
  6. Critical value at α

    α = 0.05: z* = ±1.96
  7. Score interval for the rate ratio

    95 %: [0.7448, 0.836]

The same in code

statsmodels
from statsmodels.stats.rates import test_poisson_2indep, confint_poisson_2indep

test_poisson_2indep(2062, 23671.791, 2601, 23560.917, value=1, method='score', compare='ratio', alternative='two-sided')
confint_poisson_2indep(2062, 23671.791, 2601, 23560.917, method='score', compare='ratio', alpha=0.05)
scipy: the exact conditional test
from scipy import stats

stats.binomtest(2062, 4663, p=0.5012, alternative='two-sided')
Excel
B1: =(2062-1.0047*2601)/SQRT((2062+2601)*1.0047)
B2: =2*(1-NORM.S.DIST(ABS(B1), TRUE))
statsmodels names the one-sided alternatives 'larger' and 'smaller'. Excel has no rate-ratio test: the exact route is BINOM.DIST on group 1's share (doubling the smaller tail for a two-sided test, which can differ from scipy's rule), and the score test is by formula.

Formulas

r is the ratio of the counts H₀ expects, given the exposures; the score test measures how far y₁ lies from r y₂.

Try this

  1. Exposure matters

    Open Meridian H1 and halve the standard group's exposure (to 11,780 vehicle-years) without changing its claims.

    Look for: The same 2,601 claims over half the exposure is twice the rate: the ratio falls to about 0.39. Counts alone say nothing until they are divided by exposure.

  2. Score, Wald and exact

    Open the small plant and switch between the three methods.

    Look for: With 25 events in all the three intervals differ visibly; with Meridian's thousands they agree to two decimals. Use the exact test when events are few.

  3. A threshold, not zero

    Open 'At least a 10 % reduction?' and move the null ratio from 0.9 down to 0.84.

    Look for: The one-sided test keeps rejecting while the null ratio stays above the one-sided interval's upper end, about 0.83. The interval tells you every threshold the data can clear.

An unhandled error has occurred. Reload 🗙

Reconnecting…

Your connection to Hypothesis Testing Lab dropped, probably a Wi-Fi blip. Hold on while it reconnects.

The connection could not be restored. The page will reload in a few seconds.