This is work in progress and users should review the existing code before using.
The code transforms a dataset with separate columns for different years, to one with different rows for different years, in order to allow panel analysis to be done.
The code also attempts a rought calculation of the price elasticity of demand for domestic gas, along with separate estimates for different groups (according to their index of multiple deprivation (IMD) classification).
regional_prices_for_panel.csv contains data taken from DECC's quarterly energy prices, but also includes a few estmates to plug required gaps.
The code requires the NEED public use file which is available here: https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/315188/need_public_use_file_2014.csv