Skip to content

mlian031/cho-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 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.

Getting Started

git clone git@github.com:mlian031/canhopi.git
cd canhopi
R -q -e 'renv::restore()'

Raw input files are intentionally kept out of version control because some of the source files exceed GitHub's 100 MB per-file limit.

Before running the project, download the relevant data from CREA MLS and Statistics Canada and place them at these exact paths (we will try and get a version that ingests via API up soon!):

data/
  crea/
    MLS_HPI_March_2026/
      Not Seasonally Adjusted (A).xlsx
      Not Seasonally Adjusted (M).xlsx
      Not Seasonally Adjusted (Q).xlsx
      Seasonally Adjusted (M).xlsx
  statscan/
    11100190/
      11100190.csv
      11100190_MetaData.csv
    18100004/
      18100004.csv
      18100004_MetaData.csv
    34100133/
      34100133.csv
      34100133_MetaData.csv

Data Sources

MLS_HPI_March_2026 corresponds to CREA MLS Home Price Index

11100190 corresponds to Table 11-10-0190-01, Market income, government transfers, total income, income tax and after-tax income by economic family type.

18100004 corresponds to Table 18-10-0004-01, Consumer Price Index, monthly, not seasonally adjusted.

34100133 corresponds to Table 34-10-0133-01, Canada Mortgage and Housing Corporation, average rents for areas with a population of 10,000 and over.

Scripts

All analysis code lives under R/.

Run order

Intermediate steps can be run in any order once inputs exist; the final step must be last.

  1. R/income.R builds median total income panels (provinces and metropolitan) and saves the intermediate output objects to output/.
  2. R/rent.R builds a metropolitan two-bedroom rent panel (2023 real dollars) and saves the intermediate output objects to output/.
  3. R/crea.R builds a CREA MLS house price benchmark panels (provinces and metropolitan, 2023 real dollars) and saves the intermediate output objects to output/.
  4. R/join_panel.R merges the above into the published provincial and metropolitan panels (and CSV exports).
  5. R/bsadf.R computes Backward Supremum ADF (BSADF) paths and generalized SADF (GSADF) test-statistic summaries for each region’s series, using exuber. Requires output/prov_panel.rds and output/metro_panel.rds from step 4.

From the repository root for example:

Rscript R/income.R
Rscript R/rent.R
Rscript R/crea.R
Rscript R/join_panel.R
Rscript R/bsadf.R

Helper scripts

File Role
R/lookups.R Shared province_lookup and metro_lookup tables so CREA region names align with Statistics Canada geography labels used in the Statistics Canada tables.
R/cpi_helper.R build_monthly_cpi_dfltr() for monthly series (CREA) and build_annual_cpi_dfltr() for annual series, using table 18-10-0004-01 (All-items CPI, 2002=100). Real-dollar base year is 2023 in the current code to match with the income data dollars.

Output artifacts

File Description
output/prov_med_income.rds Provincial median income (annual).
output/metro_med_income.rds Metropolitan median income (annual).
output/metro_rent.rds Metropolitan two-bedroom rent (annual, real 2023$).
output/prov_crea_series.rds Provincial CREA benchmarks (monthly, real 2023$).
output/metro_crea_series.rds Metropolitan CREA benchmarks (monthly, real 2023$).
output/prov_panel.rds / output/provincial_panel.csv Final provincial panel and CSV export, long format.
output/metro_panel.rds / output/metro_panel.csv Final metropolitan panel and CSV export, long format.
output/bsadf/prov_bubble_paths.rds / output/bsadf/prov_bubble_paths.csv Provincial BSADF paths, critical values, and exuberance flags (95% level) per date.
output/bsadf/metro_bubble_paths.rds / output/bsadf/metro_bubble_paths.csv Metropolitan BSADF paths.
output/bsadf/prov_bubble_summary.rds / output/bsadf/prov_bubble_summary.csv Provincial GSADF statistics and critical values per region.
output/bsadf/metro_bubble_summary.rds / output/bsadf/metro_bubble_summary.csv Metropolitan GSADF summaries.

Contact

Maintainer: Mike Liang (mlian031@uottawa.ca)
Issues: Report here

Acknowledgements

We thank the Dallas Federal Reserve, Lancaster University Management School (LUMS), International and UK Housing Observatory for inspiring this work.

About

Canadian Housing Observatory Data Repository

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages