The city council claims their recent road safety campaign has reduced the daily accident rate. The following are the daily data collected over 20 days. The mean rate before the campaign was 5.
4, 6, 4, 1, 1, 5, 5, 6, 3, 5, 1, 8, 3, 2, 5, 7, 5, 2, 3, 4
The first thing to realise here is that the number of accidents is entirely random, although it may revolve around a mean (rate). Therefore, the hypothesis tests based on normal distribution, such as t.test, are not applicable here. We use the Poisson test on such occasions.
poisson.test(80, 20, 5, alternative = "less")
Here, 80 is the sum of the counts, and 20 is the total duration (days) over which the samples were collected.
Exact Poisson test
data: sum(x) time base: 20
number of events = 80, time base = 20, p-value = 0.02265
alternative hypothesis: true event rate is less than 5
95 percent confidence interval:
0.000000 4.817502
sample estimates:
event rate
The p-value = 0.022, and we reject the null hypothesis, H0 (that the event rates are equal), at a significance level of 5%.