library("strucchange")
data("BostonHomicide")
attach(BostonHomicide)
## data from Table 1
tapply(homicides, year, mean) 1992 1993 1994 1995 1996 1997 1998
3.083333 4.000000 3.166667 3.833333 2.083333 1.250000 0.800000
populationBM[0:6*12 + 7][1] 12977 12455 12272 12222 11895 12038 NA
tapply(ahomicides25, year, mean) 1992 1993 1994 1995 1996 1997 1998
3.250000 4.166667 3.916667 4.166667 2.666667 2.333333 1.400000
tapply(ahomicides35, year, mean) 1992 1993 1994 1995 1996 1997 1998
0.8333333 1.0833333 1.3333333 1.1666667 1.0833333 0.7500000 0.4000000
population[0:6*12 + 7][1] 228465 227218 226611 231367 230744 228696 NA
unemploy[0:6*12 + 7][1] 20.2 18.8 15.9 14.7 13.8 12.6 NA
Analysis of Variance Table
Response: homicides
Df Sum Sq Mean Sq F value Pr(>F)
populationBM 1 14.364 14.3642 3.7961 0.05576 .
season 11 47.254 4.2959 1.1353 0.34985
Residuals 64 242.174 3.7840
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Analysis of Deviance Table
Model: poisson, link: log
Response: homicides
Terms added sequentially (first to last)
Df Deviance Resid. Df Resid. Dev Pr(>Chi)
NULL 76 115.649
populationBM 1 4.9916 75 110.657 0.02547 *
season 11 18.2135 64 92.444 0.07676 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1