Skip to content
This is a series of scripts, written in R used to create the structured csv files the National Household Model can use to import and create housing stocks from.
R Other
  1. R 99.9%
  2. Other 0.1%
Branch: master
Clone or download
larkery Merge pull request #7 from cse-bristol/master
Per #000187, update stock files creator to handle EHS2014.
Latest commit 11af9b3 Jul 10, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.

This repository is a development copy of the publically visible : National Household Model Stock File Creator repository.

#Small edit: updated data series reference


A series of R scripts that can be used to create structured zip file known as the 'Default Import Package' that can be imported by the National Household Model as a housing stock. For more information on the content and structure of files within the 'Default Import Package' please see the Stock section within the NHM documentation.

The source files from which the stock files are created cannot be distributed via this public repository, however details for how these files can be obtained can be found here. Once downloaded these files should be added to their respective directories in the '/data folder' as follows:

  1. Copy the contents of SN 8068 into folder data/EHS_2014
  2. Create a folder called 'fuel_poverty' within data/EHS_2014 and Copy the contents of SN 8069 into it
  3. Copy the contents of both the Living in Wales:Property Survey and Living in Wales:Household Survey into data/LiW-2008
  4. Copy the Scottish survey data file into data/SHCS_11-13, ensure the file is re-named external_cse_data.sav


The scripts for creating the stock files have been written in R, which will need to be downloaded and installed.

Installation for Windows

Running the script

  1. Ensure you have downloaded the required source survey files as previously mentioned.
  2. Start the R command line application or R studio
  3. Switch your workspace to the location you have downloaded this repository to using setwd("[PATH TO THE DIRECTORY]")
  4. Execute the stock creation scripts by entering 'source("main.R")'.
  5. Check the console for the status of the import, if succesful and output dirtory should be created your workspace directory, this should include sub directories for scotland, england and wales and uk. Each of these sub-directories should include the structured csv files and a zip file which can be imported into the NHM standalone as a stock.


[Open Government License] (

You can’t perform that action at this time.