Section: Module 5 - Running the model in R or the Shiny app | Cities Spatial Model Training | Short Courses

Main course page
  • General

    • About the course

      This online training course provides a practical, in-depth introduction to the Cities Spatial Model, designed for policymakers, urban practitioners, analysts, and researchers working on city planning and economic development. The course builds a clear intuition for how the model works and why spatial and equilibrium effects matter for urban policy.

      Participants will learn what data the model requires, where to find reliable sources, and how to clean, structure, and manipulate datasets into the formats needed for analysis using QGIS and R. Step-by-step guidance is provided on running the model in R, interpreting outputs, and using visual tools to explore results. The course also focuses on how to communicate findings clearly and effectively, translating technical outputs into policy-relevant insights that can inform real-world decisions. There is also an option to use the Shiny app interface - enabling users to upload data and run the basic model without any coding whatsoever. 

      By the end of the course, participants will be equipped with both the conceptual understanding and practical skills needed to apply the Cities Spatial Model to real urban challenges, supporting better-informed, evidence-based planning and investment decisions.

    • Meet your instructors

      Nick Tsivanidis - Associate Professor of Economics, UC Berkeley and IGC Cities Research Programme Director

      Nick Tsivanidis

      Maria Del Mar Gomez - Research Analyst, Cities Spatial Model

      Maria Del Mar Gomez - Research Analyst on the Cities Spatial Model

      Daniel Ruiz Palomo - Research Analyst, Cities Spatial Model

      Daniel Ruiz Palomo

    • Group training

      If you are looking for something more interactive, please join one of our quarterly training groups. As part of a group, you will follow the content over a week-long structured programme, including access to moderated peer discussions, a live support webinar with one of the instructors, and a capstone project to put your training into practice. The courses will start on the following dates:

      2 March 2026 [This group is now full, please select another date]

      1 June 2026 [This group is now full, please select another date]

      7 September 2026

      30 November 2026

      You can sign up here.

      Please note: Certificates are not issued for this course. The training is designed as a learning and knowledge-sharing opportunity, with an emphasis on practical understanding and application.

Module 5 - Running the model in R or the Shiny app

  • Module 5 - Running the model in R or the Shiny app

    • IMPORTANT NOTICE: We are facing delays in getting a new version of the package uploaded in CRAN. This may mean the code and instructions given in this module will return an error message when using the package. Please use the Shiny app in the meantime while we resolve this - the CRAN package should be working as per instructions again very soon! 

      Objectives

      • Translate a policy or shock into concrete changes in the model’s input variables 
      • Clearly identify and implement the steps required to run the baseline version of the model 
      • Understand the two ways to run the model  (using R code or the Shiny app) and choose the appropriate interface depending on flexibility, parameter control, and connectivity needs
    • Module contents

    • Download this folder which contains data and code sample files to show you how to prepare the data for the model. You will need to use these files to follow the steps in the video Getting the data in the right format from this module.

      Download the folder before you open the interactive module and keep the files accessible as you watch the videos

    • Download this folder which contains sample data and code to run the model in R. You will need to use these files to follow the steps in the video How to run the model  from this module.

      Download the folder before you open the interactive module and keep the files accessible as you watch the videos

      • Running the model sample files Running the model sample files
    • Lets discuss how to model policy interventions Forum
      Not available unless: You belong to any group
    • Additional resources

    • Check this pdf if you want to review the steps of the code for running the model in R