Trends in Canada’s Cost of Living of Over the Last 23 Years: Exploratory Data Analysis

Matthew Hanani
6 min readJan 14, 2023

--

This article will be used to document my analysis of NHPI, CPI, and Salary data from statcan.gc.ca. I will use Python to organize, clean, describe, and visualize this data to observe the change of Canada’s affordability over the last 23 years. Visualizations may be hard to read due to image size restriction; the full size images will be available for download on the GitHub repo.

Taking a look at the salary data first, I plot the cumulative percentage change in median total income from years 2000 to 2020 (this dataset does not include 2021 or 2022 data), for both sexes, ages 16 and over, organized by province:

Fig. 1

Measuring median income in 2020 dollars controls for fluctuations in CPI, meaning it can be taken as an estimate of purchasing power. Fig. 1 reveals purchasing power in Newfoundland and Labrador has increased the most, at 54.9%, and Ontario has increased the least, at 14.3%. However, all provinces have had a positive increase in median income, implying the average Canadian, in 2020, has more purchasing power than they did in the year 2000.

Next, I want to see if there exist any disparities between sexes in income growth. Plotting the total percentage change in median income from 2000 to 2020, separating males and females, ages 16 and over, organized by province:

Fig. 2

Gathering from Fig. 2, I’ll infer that the overall increase in median income is mostly due to the increase in women’s income, as women’s income outgrew men’s income by a large margin in every province. This is presumably due to the increasing rates of women working in more technical fields, such as STEM and finance. Something interesting is that men’s median income in Ontario dropped by 1.5%. Although this may be insignificant, the province with the second lowest growth rate was Quebec with an increase of 13.5%, which is an outstanding disparity between Ontario and the rest of Canada.

Moving on from percentage change, I want to take a look at the total median income in 2020. Plotting as a bar chart and controlling for the same parameters as Fig. 1:

Fig. 3

Albertans typically have the highest incomes, at a median of $42,500, while Nova Scotians and people from New Brunswick are tied for lowest incomes, at a median of $37,100. It’s worth noting that some of the lower-income provinces are the ones that grew the most from 2000 to 2020 (Fig. 1); perhaps these Eastern provinces may catch up to the rest of Canada if trends continue.

The NHPI, New Housing Price Index, is a measure of the price increase in new houses being listed in Canada. Looking at NHPI data, I plot the cumulative percentage change in the NHPI from years 2000 to 2022, for both sexes, ages 16 and over, organized by province:

Fig. 4

The provinces that grew the most were the prairies along with Ontario and Quebec, while the smaller eastern provinces and British Columbia grew the least. One thing to note is that the increases in house prices are generally much higher than the increases in median income from Fig. 1, implying houses have become less affordable. The massive spike in houses across Canada at the beginning of the pandemic is also visualized on this graph.

Increase in house prices isn’t extremely meaningful in isolation, so here I compare how house prices have increased compared to rent (gathered from CPI data). Plotting the total percentage change of rent prices and the NHPI from 2000 to 2022, organized by province:

Fig. 5

Fig. 5 shows that house prices have increased more than rent over all of Canada, with the exception of PEI. House prices outgrew rent by more than double in Canada as a whole, while some provinces approach nearly triple the increase. The average Canadian, in 2022, is more incentivised to rent, rather than purchase a home, compared to in 2000.

Moving on to CPI data, I want to see what items have increased the most. Plotting the total percentage change of the 10 highest growing CPI items for all of Canada, from 2000 to 2022:

Fig. 6

It is interesting that 5 out of the 10 highest growing CPI items are food items, specifically fresh produce. It also makes sense that Air transportation and Inter-city transportation is in the top 10, as Fuel oil is 3rd in terms of highest growing items.

Finally, I want to plot a choropleth map to discover what item has increased the most by province. Using a .geojson file of Canada’s provinces, I plot the highest growing CPI item by province and color code by said item:

Fig. 7

Fuel oils have dominated Canada for the highest growing CPI item along with natural gas and city transportation (possibly due to increase in fuel prices). One caveat to this is that this CPI data includes months after Russia’s invasion into Ukraine, which caused gas and fuel prices to skyrocket.

Plotting the same choropleth map, setting the cutoff date to January 2022 (before Russia’s invasion):

Fig. 8

Fig. 8 reveals that, prior to the invasion of Ukraine, the highest growing CPI item was a bit more diversified; tobacco products, home insurance, and Gasoline are now added to the mix. However, in spite of restricting the timespan, fossil fuels and related goods (city transportation) still account for highest growing costs for the majority of Canada.

The purpose of this project was to become more comfortable with Python and data analysis in general; I’ve succeeded in this regard. My comfort with cleaning, manipulating, and visualizing data in a meaningful way has greatly improved.

Moving forward I want to focus on creating statistically meaningful inferences from complex datasets and begin training/using basic machine learning models.

--

--

Matthew Hanani
0 Followers

Economics and Mathematics undergraduate at McMaster University. Interested in statistics, psychology, philosophy, and squash.