Prepare data – Weekly and daily counts

The interest is in broad patterns over time. Weekly counts give numbers that are easier to work with.

We use the function gamclass::eventCounts() to create counts of accidents, i) by week, and ii) by day, in both cases from January 1, 2006:

Fits, to the daily data, and to the weekly data

Figure 1 shows the fits to the weekly data:

Loading required package: nlme
This is mgcv 1.8-31. For overview type 'help("mgcv-package")'.
Figure 1: Fitted number of events (aircraft accidents) per week
  versus time.

Figure 1: Fitted number of events (aircraft accidents) per week versus time.

The fitted curve and confidence band that results from modeling and plotting events per day is very similar. Code to plot events per day is: