Gasoline demand: BC and the Rest of Canada

This post looks at gasoline demand across the Canadian provinces and territories. It was prompted by this tweet by @sjmuir, noting that gasoline demand per capita in BC is unchanged since 2008, the year of implementation of the BC carbon tax.

The data didn’t fit my prior as I had seen in a recent paper that shows BC gasoline demand per capita falling relative to the rest of Canada.

So what gives?

It turns out, a lot has changed since the above referenced paper. Namely, BC gasoline demand has risen quite a bit since 2015. Let’s dig in. I’ll first plot the change in total gasoline demand in each province since 2008:

library(tidyverse)
library(lubridate)
library(cansim)
library(ggrepel)
library(ggthemes)

## GET EMPLOYMENT DATA
data.gas <- get_cansim(23100066) %>% 
  normalize_cansim_values() %>%
  filter(`Type of fuel sales`=="Net sales of gasoline",
         GEO!="Northwest Territories including Nunavut") %>%
  mutate(Year=as.numeric(REF_DATE),
         Region = case_when(GEO %in% c("British Columbia","Alberta","Saskatchewan") ~ "West",
                            GEO %in% c("Manitoba","Ontario","Quebec")  ~ "Central",
                            GEO %in% c("New Brunswick","Nova Scotia","Prince Edward Island","Newfoundland and Labrador") ~ "East",
                            GEO %in% c("Yukon","Northwest Territories","Nunavut") ~ "Territories",
                            GEO=="Canada" ~ "CANADA"),
         GEO.abb = case_when(GEO=="British Columbia" ~ "BC",
                             GEO=="Alberta" ~ "AB",
                             GEO=="Saskatchewan" ~ "SK",
                             GEO=="Manitoba" ~ "MB",
                             GEO=="Ontario" ~ "ON",
                             GEO=="Quebec" ~ "QC",
                             GEO=="New Brunswick" ~ "NB",
                             GEO=="Nova Scotia" ~ "NS",
                             GEO=="Prince Edward Island" ~ "PE",
                             GEO=="Newfoundland and Labrador" ~ "NL",
                             GEO=="Yukon" ~ "YT",
                             GEO=="Northwest Territories" ~ "NT",
                             GEO=="Nunavut" ~ "NU",
                             GEO=="Canada" ~ "CAN")) %>%
  group_by(GEO) %>%
  mutate(Index=VALUE/VALUE[Year==2008]) %>%
  dplyr::select(Year,Date,GEO,GEO.abb,Region,Index,"Gasoline"=VALUE)
data.gas$Region <- factor(data.gas$Region, levels=c("CANADA","West","Central","East","Territories"))

ggplot()+
  geom_line(data=data.gas %>% filter(GEO!="Canada",GEO!="Nunavut",GEO!="British Columbia"), 
            aes(Year,Index,group=GEO,color=GEO),
            size=1)+
  geom_line(data=data.gas %>% filter(GEO=="British Columbia"),
            aes(Year,Index),
            size=2, color="firebrick")+
  geom_label_repel(data=data.gas %>% filter(Year==2017,GEO!="Canada",GEO!="Nunavut",GEO!="British Columbia"),
                   aes(Year, Index, color=GEO, label=GEO.abb),
                   nudge_x=.5)+
  geom_label_repel(data=data.gas %>% filter(Year==2017,GEO=="British Columbia"), 
                   aes(Year, Index, label=GEO.abb),
                   nudge_x=.5, color="firebrick")+
  geom_hline(yintercept = 1,linetype="dashed")+
  scale_y_continuous(labels=scales::percent)+
  scale_x_continuous(breaks=seq(2008,2018,2),limits=c(2008,2018))+
  coord_cartesian(ylim=c(.95,1.4))+
  scale_color_viridis_d(name="")+
  theme_classic(14,"Gill Sans")+
  theme(plot.caption=element_text(size=8,face="italic"),
        legend.position = "none")+
  labs(x="",y="",
       subtitle="Gasoline demand relative to 2008 (unadjusted for population)",
       caption="Statistics Canada NDM Table 23-10-0066\nChart by @bcshaffer")

It’s a busy chart but there’s a few things to note:

  1. Sask is guzzling the stuff. This isn’t per capita yet, but still!
  2. Meanwhile, BC, which showed a big dip in 2011-2014 has come roaring back.

The above chart isn’t per capita. So let’s get quarterly population estimates, annualize them, and create a gasoline_per_capita variable:

## GET POPULATION DATA
data.population <- get_cansim(0510005) %>% 
  normalize_cansim_values() %>%
  mutate(Year=year(Date)) %>%
  dplyr::select(Year,GEO,"Population"=VALUE) %>%
  group_by(GEO,Year) %>%
  summarise(Population=mean(Population)) 

## Merge and plot
plotdata <- left_join(data.gas,data.population,by=c("Year","GEO"))
plotdata$gas_per_cap <- plotdata$Gasoline/plotdata$Population/365
ggplot(plotdata, aes(Year,gas_per_cap,group=GEO,color=GEO,label=GEO.abb))+
  geom_line(size=1.5)+
  geom_vline(xintercept = 2008,linetype="dashed")+
  geom_label_repel(data=plotdata %>% filter(Year==2017),nudge_x=.5)+
  facet_wrap(~Region,nrow=1)+
  scale_x_continuous(breaks=seq(2008,2018,4),limits=c(2008,2019))+
  scale_color_viridis_d(name="",option="B")+
  theme_classic(14,"Gill Sans")+
  theme(plot.caption=element_text(size=8,face="italic"),
        legend.position = "none")+
  labs(x="",y="Litres per day",
       subtitle="Per capita gasoline demand",
       caption="Statistics Canada NDM Table 23-10-0066 and 17-10-0009\nChart by @bcshaffer")

Another question, is how different economic growth–rather than just population growth–across provinces impacts their gasoline demand. So here we look at gasoline intensity, the ratio of annual gasoline demand (in litres) per thousand dollars of GDP. (Note: I drop the territories as their scale gets wonky. Sorry Territories…)

## GET GDP DATA
data.GDP <- get_cansim(36100222) %>% 
  normalize_cansim_values() %>%
  filter(Prices=="Chained (2012) dollars",
         Estimates=="Gross domestic product at market prices") %>%
  mutate(Year=year(Date)) %>%
  dplyr::select(Year,GEO,"GDP"=VALUE) 

plotdata <- left_join(plotdata,data.GDP, by=c("Year","GEO"))
plotdata$gas_intensity <- plotdata$Gasoline / plotdata$GDP * 1000
plotdata <- plotdata %>% filter(Region!="Territories")

ggplot(plotdata, aes(Year,gas_intensity,group=GEO,color=GEO,label=GEO.abb))+
  geom_line(size=1.5)+
  geom_vline(xintercept = 2008,linetype="dashed")+
  geom_label_repel(data=plotdata %>% filter(Year==2017),nudge_x=1)+
  facet_wrap(~Region,nrow=1)+
  scale_x_continuous(breaks=seq(1995,2015,10),limits=c(1994,2020))+
  coord_cartesian(ylim=c(16,45))+
  scale_color_viridis_d(name="",option="B")+
  theme_classic(14,"Gill Sans")+
  theme(plot.caption=element_text(size=8,face="italic"),
        legend.position = "none")+
  labs(x="",y="L per $1000 GDP",
       subtitle="Gasoline intensity\n(Gas demand / GDP)",
       caption="Statistics Canada NDM Table 23-10-0066 and 36-10-0222\nChart by @bcshaffer")

It’s a little hard to tell in that graph, but in the West plot, BC is the line that starts highest and is falling rapidly throughout the period. I’ll re-plot it on one panel here:

ggplot()+
  geom_line(data=plotdata %>% filter(GEO!="Nunavut",GEO!="British Columbia"), 
            aes(Year,gas_intensity,group=GEO,color=GEO),
            size=1)+
  geom_line(data=plotdata %>% filter(GEO=="British Columbia"),
            aes(Year,gas_intensity),
            size=2, color="firebrick")+
  geom_label_repel(data=plotdata %>% filter(Year==2017,GEO!="Nunavut",GEO!="British Columbia"),
                   aes(Year, gas_intensity, color=GEO, label=GEO.abb),
                   nudge_x=1)+
  geom_label_repel(data=plotdata %>% filter(Year==2017,GEO=="British Columbia"), 
                   aes(Year, gas_intensity, label=GEO.abb),
                   nudge_x=.5, color="firebrick")+
  geom_vline(xintercept = 2008,linetype="dashed")+
  scale_x_continuous(breaks=seq(1995,2015,10),limits=c(1994,2020))+
  coord_cartesian(ylim=c(16,48))+
  scale_color_viridis_d(name="")+
  theme_classic(14,"Gill Sans")+
  theme(plot.caption=element_text(size=8,face="italic"),
        legend.position = "none")+
  labs(x="",y="L per $1000 GDP",
       subtitle="Gasoline intensity\n(Gas demand / GDP)",
       caption="Statistics Canada NDM Table 23-10-0066 and 36-10-0222\nChart by @bcshaffer")

To summarise, and make it clearer, let’s take a look at just BC and Canada side by side for both gasoline intensity and gasoline per capita:

data.summary <- plotdata %>%
  filter(GEO %in% c("British Columbia","Canada")) %>%
  dplyr::select(Year,GEO,GEO.abb,gas_per_cap,gas_intensity) %>%
  gather(key,value,gas_per_cap,gas_intensity)

ggplot(data.summary, aes(Year,value,group=GEO,color=GEO))+
  geom_line(size=1.5)+
  geom_vline(xintercept = 2008,linetype="dashed")+
  facet_wrap(~key,scales="free_y")+
  scale_x_continuous(breaks=seq(1995,2015,5))+
  scale_color_manual(name="",values=c("forestgreen","red"))+
  theme_classic(12,"Gill Sans")+
  theme(plot.caption=element_text(size=8,face="italic"),
        legend.position = "top",
        legend.text = element_text(size=14),
        strip.text = element_text(size=12))+
  labs(x="",y="",
       subtitle="gas_intensity: L/GDP ($'000s)\ngas_per_cap: L/capita/day",
       title="BC vs the Rest of Canada",
       caption="Statistics Canada NDM Table 23-10-0066, 36-10-0222, 17-10-0009\nChart by @bcshaffer")

Bottom line: gasoline intensity (the amount of gasoline demand per $1000 of GDP) is falling across the board. That’s a good thing. B.C.’s gasoline intensity is falling more rapidly than the Canadian average. On a per capita basis, despite rising in the past 2 years on the back of strong GDP growth, BC is still falling relative to the Canadian average.