Almost every organization that operates over extended periods of time accumulates legacy infrastructure, and Statistics Canada is certainly no stranger to this phenomenon. With some effort one can find workarounds for many of these, but there is one bit of data infrastructure that has been particularly infuriating: The Beyond 20/20 IVT file format. TL;DR The canivt package reads Statistics…
We have built an ecosystem of R packages for accessing and working with Canadian data, canpumf is the latest addition to this. It facilitates finding, parsing, and working with StatCan PUMF data. TL;DR PUMF data is a valuable piece of StatCan’s data products. But it’s mostly ungoverned and comes in a large variety of formats, encodings, and lack of machine-readable metadata. Sometimes people get…
CensusMapper is a web-based Geographic Information System that allows for dynamic mapping of Canadian Census data. CensusMapper is eleven years old now, and it was showing it’s age. Today CensusMapper go a major update. TL;DR Try out the new CensusMapper, it’s great! History Here we focus on what’s new in this CensusMapper update, we refer those interested in how CensusMapper started and how we…
Over the holidays I had some downtime jet-lagged in the early morning and then on various train rides, and I decided to try my hand on a little side project. I had various versions of this in the back of my mind for a while, and got recently reminded of this after discussions with Stephen Rouse who not long ago built something along those lines. The idea is simple, build a web app to dynamically…
(Joint with Nathan Lauster and cross-posted at HomeFreeSociology ) <code> library (tidyverse) library (cansim) library (cancensus) library (dotdensity) library (sf) library (mountainmathHelpers) Are people liquids or solids? Trick question: they’re kind of both. This matters in terms of how we track people and project their location forward in time. There are basic demographic methods that…
(Joint with Nathan Lauster and cross-posted at HomeFreeSociology ) <code> library (tidyverse, warn.conflicts = FALSE ) library (canpumf) library (cansim) Residential floor space offers a common denominator for trying to standardize across a range of housing metrics (e.g. price per square foot). Unfortunately we don’t have it in the Census in Canada, but we can play around with rooms to get some…
(Joint with Nathan Lauster and cross-posted at HomeFreeSociology ) <code> library (tidyverse) library (httr) library (rvest) library (VancouvR) pplos_cache_path <- here :: here ( "data/pplos" ) if ( ! dir.exists (pplos_cache_path)) dir.create (pplos_cache_path) From books to blog posts, we’ve long been on the record advocating for reforms to the regulation of low-density urban lots, enabling more…
(Joint with Nathan Lauster and cross-posted at HomeFreeSociology ) <code> library (tidyverse) library (sf) library (VancouvR) library (mountainmathHelpers) What if zoning was responsive to underlying demand to live in an area? That is, rather than reserving parts of the landscape for the exclusive use of those who can afford an entire underlying lot, what if we instead allow people to build enough…
(Joint with Nathan Lauster and cross-posted at HomeFreeSociology ) <code> library (tidyverse) library (cansim) library (canpumf) library (mountainmathHelpers) source (here :: here ( "R/mhr_pumf.R" )) source (here :: here ( "R/old_census_aehh_hh.R" )) The now well-know slogan Homelessness is a housing problem (Colburn and Aldern 2022) alludes to the fact that structural homelessness is caused by…
(Joint with Nathan Lauster and cross-posted at HomeFreeSociology ) <code> library (tidyverse) library (canpumf) library (cansim) library (mountainmathHelpers) library (cancensus) library (tinytable) library (cmhc) source (here :: here ( "R/mhr_pumf.R" )) source (here :: here ( "R/mhu.R" )) source (here :: here ( "R/census_import.R" )) Last week StatCan published a report on Housing use of…
<code> library (tidyverse) #remotes::install_github("mountainmath/mountainmathHelpers") library (mountainmathHelpers) library (sf) library (rmapshaper) library (cancensus) my_theme <- list ( labs ( caption= "MountainMath, Elections Canada" ) ) Following our posts on the 2019 election and 2021 election we might as well re-use the code to run a high-level analysis of the 2025 federal election…
(Joint with Nathan Lauster and cross-posted at HomeFreeSociology ) In our new paper “The new rules: housing shortage as an explanation for family and household change across large metro areas in Canada, 1981-2021” (Lauster and Bergmann 2025) ( preprint and replication code ) we estimate the impacts of housing shortage on the substantial variation we see in family and household structures, both…
<code> library (tidyverse) library (cansim) library (bench) cansim_repartition_cached_table ( "46-10-0070" , new_partitioning = c ()) # Ensure we are starting with unpartitioned parquet With version 0.4 cansim package got a major revamp. The cansim package has been available con CRAN since late 2018 and has undergone number of improvements since then. It started out focused on retrieving entire…
We don’t yet have the final results for the 2024 BC provincial election, we are still waiting on the count of the vote-by-mail ballots that have not arrived yet. Some ridings are still in limbo, as is the overall outcome and who will form government. But most ridings have been called and we wanted to take this opportunity to replicate a map highlighting the difference between land and people as we…
(Joint with Nathan Lauster and cross-posted at HomeFreeSociology ) Who would benefit from dramatically expanding the supply of housing in the market? How would such an expansion address housing need? What non-market interventions would still be required to meet remaining need? How would it influence household formation and migration? This post is picking up where we left off on our housing targets…
Determining the exact location of data points comes with measurement errors, in particular when geographic locations is derived from geocoding. Data that gets aggregated by geographic areas relies on geocoding to determine which area each data point belongs to. Geocoding is the process of converting addresses into geographic coordinates, which can then be used to determine which area each data…
(Joint with Nathan Lauster and cross-posted at HomeFreeSociology ) How does owning or renting relate to household independence across the life course? How have these relationships changed over recent history? We use Census data from 1981-2021 to check in on historical relationships between age, tenure, and household composition. From these we develop a couple of preliminary demographic metrics of…
(Joint with Nathan Lauster and cross-posted at HomeFreeSociology ) New data supports a common theme: Housing costs seem to be increasingly important as a determinant of long-distance migration, adding to their traditional importance within short-distance moves. But there are still some interesting caveats. We have a look at the data, compare it to what we know of flows, and think through some of…