October 9, 2017

Description

These slides investigate the data in the two datasets in the default R package:

UKDriverDeaths is a time series giving the monthly totals of car drivers in Great Britain killed or seriously injured Jan 1969 to Dec 1984. Compulsory wearing of seat belts was introduced on 31 Jan 1983.

Seatbelts is more information on the same problem. Those considered here are: - kms: total distance driven. - PetrolPrice: Price of petrol - Law: 0/1: was the seatbelt law in effect that month?

Plot the data

The plot shows a large amount of periodic variation. If we do not consider this then underlying trends maybe less visible.

Exploring seasonal trends

Use ARIMA model

## 
## Call:
## arima(x = log10(Seatbelts[, "drivers"]), order = c(1, 0, 0), seasonal = list(order = c(1, 
##     0, 0)), xreg = X)
## 
## Coefficients:
##          ar1    sar1  intercept     kms  PetrolPrice      law
##       0.3348  0.6672     3.3539  0.0082      -1.2224  -0.0963
## s.e.  0.0775  0.0612     0.0441  0.0902       0.3839   0.0166
## 
## sigma^2 estimated as 0.001476:  log likelihood = 349.73,  aic = -685.46

The results show a significant affect of 'Law' on deaths. That is the seatbelt law did decrease the death rate. Instead of modelling the seasonal effect we could have smoothed the results to remove the trend. This shiny app explores these options.