This link including the code and the data that we used in this dissertation.
The Python file is more about the preprocessing of the data, apply the regression and the K-means clustering.
The R file is to apply the spatial analysis inlcuding the Moran's I, Lagrange Multiplier, and Spatial Error Model.
The shpfile of the postcode area is from: https://datashare.ed.ac.uk/handle/10283/2597