The supplementary material contains both data and software to fit the model in the paper. The software includes the following files.

PCkernel.R - function to fit the Kernel smoothing model given by  (3.1), (3.2) and (3.3).

PClocalised.R - function to fit the locally adaptive smoothing model given by  (3.1), (3.2) and (3.4).

PCST.cpp - C++  functions to sample parameters in both Kernel and localised weight models.

common.functions.R - R helper functions.

Run the analysis.R - script file that reads in the data and fits both Kernel and locally adaptive weight models with m=8.

Also provided with this supplementary material is the data GPdata.csv, which contains the following columns.

code - unique code of each GP surgery. 
month -   the month the data relate to. 
prev -   the number of prescriptions for preventer medication. 
reli -   the number of prescriptions for reliever medication. 
board - health board the GP surgery resides in.
easting - east-west geographical coordinate of the GP surgery.
northing - north-south geographical coordinate of the GP surgery.
dep.simd - the percentage of patients that live in the 15\% most deprived datazones as measured  by the Scottish Index of Multiple Deprivation (SIMD).
pm25 - estimated PM$_{2.5}$ concentrations.    
Eprev - the expected number of prescriptions for preventer medications.
Ereli - the expected number of prescriptions for reliever medications.
SPRprev - the standardised prescription rate for preventer medications.
SPRreli - the standardised prescription rate for reliever medications.
urban - the level of urbanicity of the location of the GP surgery.