Skip to content

mlian031/canhp-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Canadian Housing Observatory Data Repository

This repository serves as the upstream data source for all Canadian Housing Observatory repositories and releases.

It builds monthly Canadian housing panel datasets from CREA MLS HPI data and Statistics Canada economic, demographic, credit, and CPI tables.

The main outputs are monthly provincial and (select) metropolitan panel datasets saved as RDS files under data/processed/.

Contents

Data Sources

This project uses publicly available data from the following sources:

Source Table or Product Frequency Use
CREA MLS Home Price Index, Seasonally Adjusted Monthly Monthly Home price indexes and benchmark prices
Statistics Canada Table 18-10-0004-01, Consumer Price Index, monthly, not seasonally adjusted Monthly CPI deflators
Statistics Canada Table 34-10-0145-01, CMHC conventional mortgage lending rate, 5-year term Monthly Mortgage rate
Statistics Canada Table 36-10-0639-01, Credit liabilities of households Monthly Mortgage credit
Statistics Canada Table 36-10-0112-01, Current and capital accounts - Households, Canada Quarterly National household income
Statistics Canada Table 36-10-0224-01, Household sector, current accounts, provincial and territorial Annual Provincial household disposable income
Statistics Canada Table 17-10-0009-01, Population estimates Quarterly Population estimates

Outputs

File Description Frequency Coverage
data/processed/monthly_provincial_panel.rds Monthly provincial housing panel Monthly 2005-01 to 2026-03
data/processed/monthly_metropolitan_panel.rds Monthly metropolitan housing panel Monthly 2005-01 to 2026-03

The provincial panel contains 9 provincial geographies. The metropolitan panel contains 50 CREA metropolitan geographies.

Software Requirements

The project is written in R and uses renv for dependency management.

To get started, run:

renv::restore()

Reproducing the Data

Run the scripts from the repository root in the following order:

Rscript R/01_download_crea_hpi.R
Rscript R/02_statcan.R
Rscript R/03_crea.R
Rscript R/04_join_data.R
Script Description
R/01_download_crea_hpi.R Downloads and extracts the latest available CREA MLS HPI workbook
R/02_statcan.R Downloads and prepares Statistics Canada source tables
R/03_crea.R Parses CREA HPI worksheets and saves geography-level intermediate files
R/04_join_data.R Joins CREA and Statistics Canada data into final monthly panel datasets

Repository Structure

R/
  01_download_crea_hpi.R
  02_statcan.R
  03_crea.R
  04_join_data.R

data/
  raw/
    crea/
  intermediate/
    crea/
    statcan/
  processed/

renv/
  renv.lock
  DESCRIPTION
  Makefile

Method Notes

CREA benchmark prices are converted to 2023 dollars using CPI values from Statistics Canada Table 18-10-0004-01.

Mortgage credit growth, income growth, and population growth are calculated as year-over-year log changes.

Quarterly population data are joined using the corresponding calendar quarter. Annual provincial household disposable income is joined to each month by calendar year.

Household disposable income per capita is calculated as annual real household disposable income divided by average quarterly population for the same province and year.

Known Data Lags and Limitations

Statistics Canada source tables are released on a different schedule than the CREA MLS HPI dataset. As a result, the most recent months (e.g. 2025, 2026) may contain missing values for some joined variables.

Currently:

  • Mortgage credit data end in 2026-02, while CREA data extend to 2026-03.
  • Provincial household disposable income data end in 2024, so income-based measures are missing for 2025 and 2026.

Citation

When using this repository, please cite this repo, and also cite the original data providers.

Liang, M. (2026). Canadian Housing Observatory Data Repository [Data and code]. GitHub. https://github.com/mlian031/canhp-data

Statistics Canada Tables

Statistics Canada. (2026). Table 18-10-0004-01 Consumer Price Index, monthly, not seasonally adjusted [Data table]. https://doi.org/10.25318/1810000401-eng

Statistics Canada. (2026). Table 34-10-0145-01 Canada Mortgage and Housing Corporation, conventional mortgage lending rate, 5-year term [Data table]. https://doi.org/10.25318/3410014501-eng

Statistics Canada. (2026). Table 36-10-0639-01 Credit liabilities of households [Data table]. https://doi.org/10.25318/3610063901-eng

Statistics Canada. (2026). Table 36-10-0112-01 Current and capital accounts - Households, Canada, quarterly [Data table]. https://doi.org/10.25318/3610011201-eng

Statistics Canada. (2025). Table 36-10-0224-01 Household sector, current accounts, provincial and territorial, annual [Data table]. https://doi.org/10.25318/3610022401-eng

Statistics Canada. (2026). Table 17-10-0009-01 Population estimates, quarterly [Data table]. https://doi.org/10.25318/1710000901-eng

CREA Data

Canadian Real Estate Association. MLS® Home Price Index [Data product]. https://www.crea.ca/housing-market-stats/mls-home-price-index

License

The code in this repository is licensed under the MIT License. See LICENSE.

About

Monthly provincial and select metropolitan panel datasets of Canadian housing markets with select indicators

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors