info
Thank you for visiting my website!

Red Light

Ottawa Red Light Violations Analysis

The Case and Background Information

At the time of writing this (2021-12-30), the City of Ottawa has 61 redlight cameras. Their data from 2016-2020 of red light camera violations is available on their website. Some of the locations have had cameras installed after 2016, so they do not have data in the given years prior to the installation. Therefore, the total number of locations with data entries is 281. With this dataset, I thought it would be worthwhile to analyze the data looking from the lens of when and which cameras are worth maintaining from a financial point of view.

There are costs to consider for each red camera installation, mainly breaking down into (a) start-up costs (engineering, equipment purchase, installation, etc.) and (b) operating costs (staffing, maintenance, etc.). Based on my online research, Ottawa has claimed that each camera costs approximately $35,000. The City of Ottawa did not specify whether $35,000 per year per camera is for just the cameras themselves or including the maintenance/operating costs or whether the company gets any percentage of tickets. So more research was done and Kingston provided data that it costs around $53,000 per camera just for the operation of the red light camera system, not counting staffing costs. Sometimes, red light camera companies will lower the price of the cameras in exchange for a part of the ticket revenues the city gets back. Each ticket is $325: $60 goes to Ontario and the City of Ottawa gets $260 and $5 goes to the courts.

So for the sake of this project, I will be basing my assumptions of the total cost to be $53,000 per year per camera, with the revenue being 260$ per ticket issued.

The main question I imagine the City of Ottawa would want to know is how to maximize their profit while decreasing aggressive driving behaviour using strategically placed red-light cameras.

This problem will be broken down into three main sub-sections, which focus on different aspects of the main problem:
Question 1) Which month(s) see the most number of violations?
Question 2) Which location(s) have the most violations (2016-2020)? 2021 update
Question 3) Which locations, if any, had a statistically significant change in the redlight camera violation occurrences for the year 2020? 2021 update
For the questions, it is important to analyze the current data available (2020) to see patterns due to regular changes that would occur year-over-year but also major changes that would have occurred during the pandemic (beginning mid March 2020 in Ottawa). It is also useful to analyze previous yearly data because it provides us with a larger picture of patterns that might occur through the years.

Based on the costs, we would want to analyze what the breakeven point is to make the cameras worth maintaining.
Assuming a cost of $53,000 per camera per year with revenue of $260, we get 204 violations:
$53,000 divided by $260/violation = 203.8 ~ 204 violations
This would mean that we would expect each camera to get 204 violations each year in order to breakeven for the cost it takes to run it each year.

Analysis

Question 1) Which month(s) see the most number of violations?

We want to analyze this, to know which months we should ensure that we allocate more funding for those months to keep up with maintenance that may occur.

Hypothesis:

The summer months will show a higher number of violations, as I speculate that more people tend to be out during the summer months. A bigger population of drivers will draw a bigger set of redlight violations.

Data:

204 violations divided by 12 month would be 17 violations on average per month per camera.

Findings for 2020 - excluding null values from the data set
In this data set there are 61 cameras, meaning, we would expect 1037 (61 cameras * 17 violations) total violations per month and 17 violations on average per month to breakeven.


Figure 1: Total red light camera violations for all active Ottawa locations in the year 2020 broken down by months.




Figure 2: The mean red light camera violations per month for all active Ottawa locations in the year 2020.

As can be seen all months do surpass both the mean (17 violations) and the total (1037 violations) violations.

Findings for 2016-2020 - excluding null values from the data set:
In this data set there are 281 cameras, meaning that we would expect 4777 total violations per month and 17 violations on average per month to breakeven.


Figure 3: Total red light camera violations for all active ottawa locations in the years 2016 to 2020 broken down by months.




Figure 4: The mean red light camera violations per month for all active ottawa locations in the years 2016-2020.

As can be seen all months do surpass both the mean (17 violations) and the total (4777 violations) violations.

Conclusion:
I was curious to see if there was a statistical significance in the two different methods of collecting data: looking at the total versus the mean but the pattern seemed to hold true in both cases.

As can be seen in the data below, for all three cases, we did see an increase in the summer months. When comparing the 2020 data versus the 2016-2020 data, we see a very similar trend where summer has the most violations. What is interesting to note is that when taking into account more years, the winter violations seemed to be further decreased in relation to the other months.

As the data is limited, we can only speculate what causes this increase in redlight violations. Some of my theories are:

Extension:
If we had the number of drivers on a monthly average that pass by intersections we would be able to have a percentage of drivers that get red light violations. This would then allow us to see if the percentage stays the same in all months, if so, then we can confirm it is because we see a large amount of drivers in the summer. If the percentage changes based on the season, then we would have to dig further into what other factors would be at play.

Question 2) Which location(s) have the most/least violations?

We want to analyze this to see which locations provide the most revenue to ensure they are maintained the most. We also want to know which locations have the least violations, to see if they are worth maintaining. If there are locations that are not worth maintaining it would be wise to look into removing the red light cameras and moving them to a more prominent and more strategic location.

Hypothesis:

The downtown neighbourhood (and directly surrounding areas) will have a higher number of redlight violations as it is a busier neighbourhood.

Data:

Each location should have approximately 204 violations total in the whole year to breakeven. This would mean we would look at total violations of 204 and monthly mean of 17 per camera location to breakeven.

Monthly mean and highest monthly total here are extremely correlated (Pearson’s r = 0.9789 for grouped by location regardless of year data and r = 0.9412 for the data for each individual location and year), so for the purpose of this project monthly mean was used. Also the correlation between total violations and monthly mean was relatively high (Pearson’s r = 0.9124 for grouped by location regardless of year data and r = 0.9342 for the data for each location and year). However, it is still important to explore the top and bottom locations for both the monthly mean and the total violations because this will give us more insight into locations that could have a higher yield in revenue. It would be wise to analyze the monthly mean, to ensure that we are getting a picture of the average that is not affected as greatly by outliers. The total violations are also important to analyze because at the end of the day we would like to know which locations are financially worthwhile overall.

Top 10 Mean/Total violations:

Figure 5a: Looking at the top 10 locations in terms of monthly mean violations for 2016-2020
Figure 5b: Looking at the top 10 locations in terms of the average total violations for 2016-2020


Bottom 10 Mean/Total violations:

Figure 6a: Looking at the bottom 10 locations in terms of monthly mean violations for 2016-2020
Figure 6b: Looking at the bottom 10 locations in terms of the average total violations for 2016-2020


Top 20 Mean/Total violations:

Figure 7a:Looking at the top 20 locations for 2016 to 2020 in terms of monthly mean violations for each separate year
Figure 7a:Looking at the top 20 locations for 2016 to 2020 in terms of the total violations each year


Bottom 20 Mean/Total violations:

Figure 8a: Looking at the bottom 20 locations for 2016 to 2020 in terms of monthly mean violations for each separate year
Figure 8b: Looking at the bottom 20 locations for 2016 to 2020 in terms of the total violations each year


Mean/Total All Heat Map:

Figure 9a: Heatmap for the monthly mean violations for each location for years 2016-2020.
Figure 9b: Heatmap for the total violations for each location for years 2016-2020.


Interpretation:
As can be seen in the visual displays of the data (Figures 5-9) , the main locations that have the most violations are downtown (Centretown and Lowertown) and the Alta Vista area. While the areas that have the lowest violations are the suburbs: Kanata, Barrhaven, and South Keys.

Grouped Mean/Total violations Horizontal Bar Graph:

Figure 10a: Each location (2016-2020 data has been combined using mean) with the corresponding monthly mean violations.
Figure 10b: Each location (2016-2020 data has been combined using mean) with the corresponding total violations.

The line denotes the breakeven point for each location. Any location that does not meet the threshold of the breakeven amount has been highlighted in pink.

Interpretation:
The locations which do not breakeven using the average for years 2016-2020 for monthly mean:

On top of those locations that do not breakeven for monthly mean, these locations do not breakeven for the average of 2016-2020 total violations:

All Locations Horizontal Bar Graph:

Figure 11a: For each location with corresponding years the corresponding monthly mean violations were analyzed.
Figure 11b: For each location with corresponding years the corresponding total violations were analyzed.

The line denotes the breakeven point for each location.

Interpretation:
Looking at the data (Figure 11) using all years and taking the locations that did not breakeven from the grouped data (Figure 10) we can see that the same locations still did not breakeven:

Some new locations which have decreased to below the breakpoint for just 2020 are: We can also see that Conroy @ Lorry Greenberg: Southbound is very close to being below breakpoint for total violations

We can see from the above locations, upon further inspection that:

Through the outliers analysis there were a couple of interesting findings:

Conclusion:

Cameras to Consider Removing
The following locations did not breakeven and should be examined about whether it is beneficial to still keep the cameras at that location or potentially move it to different locations:

Location and
Installation Year
Total Violations
2020
Monthly Mean
2020
Revenue for 2020
($260 per violation)
Money Lost 2020
(Breakeven point:
$4,416.67 per month
and $53,000 per year)
Years of
Negative Profit
Carling @ Island Park:
Eastbound;

2008
51
4.25
Monthly Avg: $1,105

Total: $13,260
Monthly Avg Loss:
$4,416.67 - $1,105 = $3,311.67

Total Yearly Loss:
$53,000-$13,260= $39,740 per year
2018, 2019 and 2020
all fall below the
breakeven threshold
Hawthorne @ Leitrim:
Northbound;

2017
70
5.833333
Monthly Avg: $1,516.67

Total: $18,200
Monthly Avg Loss:
$4,416.67 - $1,516.67 = $2,900

Total Yearly Loss:
$53,000-$18,200= $34,800 per year
Since install 2017;
October 2019 had a data
anomaly which seems
incorrect, so this will not
be included towards the profit.
Innes @ Orleans:
Southbound;

2017
125
10.416667
Monthly Avg: $2,708.33

Total: $32,500
Monthly Avg Loss:
$4,416.67 - $2,708.33 = $1,708.34

Total Yearly Loss:
$53,000-$32,500 = $20,500 per year
Since install 2017;
October 2019 had a data
anomaly which seems
incorrect, so this will not
be included towards the profit.

Locations to track how 2021 goes, because have started to show trends of decreasing:

Location Total Violations
2020
Monthly Mean
2020
Revenue for 2020
($260 per violation)
Money Lost 2020
(Breakeven point:
$4,416.67 per month
and $53,000 per year)
Years of
Negative Profit
Aviation Parkway @ Ogilvie:
Westbound
155
12.916667
Monthly avg: 3358.33

Total: 40300
Monthly Avg Loss:
4416.67 - 3358.33 = $1,058.34

Total Yearly Loss:
53000-40300= $12,700 per year
Only 2020.
2019 was very close
to not breaking even
(total = 213,
mean = 19.363636)
Conroy @ Lorry Greenberg:
Southbound
217
18.083333
Monthly avg: 4701.67

Total: 56420
Monthly Avg Gain:
4416.67 - 4701.67 = $285

Total Yearly gain:
53000-18200= $3,420 per year
None
We can see that Conroy @ Lorry Greenberg: Southbound is very close to being below breakpoint for total violations

Cameras to Prioritize for Maintenance
The top 10 locations for both monthly means and total violations were analyzed to see which locations should be ensured they are maintained throughout the year as they yield high revenue. The following locations were active consistently for 12 months:

  1. King Edward @ St. Patrick: Southbound
  2. Kent @ Arlington: Northbound
  3. Russell @ St-Laurent: Southbound
  4. King Edward @ St. Andrew: Northbound
  5. Catherine & O'Connor @ Hwy 417 WB: Westbound
  6. Bank @ Riverside South: Northbound
The following two locations ranked highly, despite being installed partway through 2020. The high total yield despite the missed revenue for these locations demonstrate the need to ensure the redlight cameras are properly maintained:
  1. Walkley @ Ryder / Don Ried: Westbound - installed in August 2020; was inactive for 7 months in 2020. Therefore, the revenue lost: 131 monthly mean violation * 7 months * $260 revenue = $246,673 lost revenue.
  2. King Edward @ Besserer: Northbound - installed in May 2020; was inactive for 4 months. We have 177.375 ~ 177 monthly mean violations, however, using the knowledge we gained in the first part of this report (see Figure 3/4), we know that the winter months tend to have the lowest amount of tickets. Looking at the data we see the lowest values range from 158-164, so let’s assume the number of tickets would be closer to the low end of 160 instead of the mean of 177. Therefore, the revenue lost: 160 monthly mean violations * 4 months * $260 revenue = approx $166,400 lost revenue.
Another interesting location to mention that had high monthly mean but low total violations:
  1. Elgin / Pretoria Bridge @ Queen Elizabeth - was inactive for 5 months during January - May 2020. Therefore, the revenue lost: 76.857143 ~ 76 monthly mean violations * 5 months * $260 revenue = approx $98,800 revenue lost.

It is important to note that although Heron @ 155m W Of Bank: Eastbound had a consistently high number of violations since install in 2017, in 2020 it started to decline during COVID restrictions (March 2020), with a sharp decrease in April and May. This is why this location is no longer recommended to ensure it is up and running. It would be a good idea to analyze this redlight camera once restrictions from COVID have fully been removed, to see if there will be an increase in violations again.

2021 Update
Findings:

Top 10 Locations

Below you will find a table looking at the top 10 locations for both 2020 and 2021 (using the monthly mean and the total yearly violations).

What we can see that there are some consistencies between the years, such as King Edward @ St. Patrick and @ St. Andrew, Russell @ St-Laurent, Kent @ Arlington, Bank @ Riverside S., and Walkley @ Ryder / Don Ried. But we can also see that there are some locations that have dropped out such as King Edward @ Besserer.

Breakeven Locations

Interestingly some locations only fell below breakeven for 2020, but jumped back up for 2021:

These locations still are not breaking even in 2021:

These locations are not breaking even but just starting in 2021, so stay tuned to them:

These locations are continuously zero for most years and most likely are no longer running:

Here are more detailed calculations for locations that are not breaking even (and their historical profit):

Conclusion:

Locations consistently losing the city money:

Locations that just started losing money in 2021, to keep an eye on for next year:

Locations to ensure they are being maintained (because they always give a big return):

Locations that have a high return right now:



Question 3) Which locations, if any, had a statistically significant change in the redlight camera violation occurrences for the year 2020?
Hypothesis:

Most downtown locations will see a statistically significant drop in the number of violations in 2020 because there were less people travelling from their homes due to COVID lockdowns and restrictions. Ottawa is a very government employed city, and since the majority of workers were sent to work from home, I would expect downtown to not have nearly as much traffic as it normally does.

Data:
Line Graph:


Figure 12a: Line graph of all 2020 camera locations and their corresponding number of monthly red-light camera violations.

Figure 12b: Line graph of all 2019 camera locations and their corresponding number of monthly red-light camera violations.

Figure 12c: Line graph of all 2018 camera locations and their corresponding number of monthly red-light camera violations.

Interpretation:
The 2020 (Figure 12a) data shows a big decline in all locations in March/April. Since neither the 2019 nor the 2018 data seems to show the same large decline for all locations as 2020 for March/April, we can say that the initial set of COVID restrictions (which began in Ottawa mid-March 2020) did seem to impede the number of traffic violations. However, Figure 12a shows a bounce back to normal levels around May/June. This is looking at the general trend of all locations, however, we want to have a more precise breakdown per each location, so we will be looking at a t-test.

T-test:



Figure 13: Table containing all locations that have a p-value less than 0.05.

Map of Locations where Decrease from 2019 to 2020 is Statistically Significant


Figure 14: Statistically significant decreases in locational red-light camera violations.


Figure 15: Statistically significant decreases in locational red-light camera violations from 2019 to 2020 (beige) compared to not statistically significant changes (light gray).

We can see that downtown has locations which have decreased, but in relation to how many cameras are found downtown, there wasn't as big of a decline as can be seen with Alta Vista. Alta Vista was hit the hardest with decreases. We can also see that Kanata (all cameras) and Gloucester (1/2 their cameras) also had a relatively high number of decreases (when compared to how many camera locations they have). Alpha level 0.05 was selected as this is the most common threshold for statistical significance.

Conclusion:

My hypothesis was not supported with the data. The location which seemed to have the largest decreases was Alta Vista (almost all of their cameras had seen a significant decrease -which can be seen in Figure 15. Also notable is that Kanata and Gloucester were also part of the locations that had a noticeable decrease in violations. Kanata had both of their cameras showing a significant decrease and Gloucester having half of their cameras showing a significant decrease.

This decrease in violations could be due to the COVID restrictions which probably led to more people staying at home meaning less people driving. Another reason for this occurrence could be due to the fact that red-light cameras are hypothesized to decrease violations the longer they are kept in place, meaning this could be a natural decrease in violations that we are seeing. In order to find which cause it most likely is, more research would need to be done.



2021 Update
Findings:

Number of locations that are statistically significantly different:

from 2019 to 2020: 24 locations
from 2020 to 2021: 38 locations


Table: Looking at violation count changes that are statistically significant by location - p-values less than 0.05 (p-values that are greater than 0.05 are blacked out). Red box means a decrease between years highlighted; green means an increase.



From 2019 to 2020 we can see all are decreases, except:

From 2020 to 2021 we see majority are an increase except:

There were 11 locations which saw a statistically significant decrease from 2019 to 2020 but then saw a statistically significant increase from 2020 to 2021:


Figure: Statistically significant decreases in locational red-light camera violations from 2019 to 2020 (red) compared to (mostly) increases from 2020 to 2021 (green)


Extensions