Introduction

The invisible nature of capital in a financialised system means ‘wealth’ can be difficult to spatialise. House prices can be used to measure spatial wealth inequality, as they have a fixed location1. Wealth from housing assets has been identified as a central driver of modern wealth inequalities in Western Europe2. Spatially uneven house price appreciation rates contribute to further wealth inequality between rich and poor households; since homeowners in more desirable and expensive areas typically see much higher capital gains. Furthermore, there is substantial evidence that intergenerational mobility, the ability for individuals to move up and down the social ladder, is mediated by housing market inequality3.

House prices are also a key mediator of social inequality, sorting populations into areas with different advantages4. Recent trends have pointed to the further sub-urbanisation of poverty, as prices in the city centre rise, lower-income groups are pushed out of central neighbourhoods to areas with poorer access to services5. In addition, due to limited residential location choice, less affluent population groups are more exposed to environmental risks caused by poor quality housing, such as dampness, noise, poor sanitation, poor neighbourhood environmental quality6, and energy and transport poverty7. High house prices are associated with better quality housing, access to quality urban amenities, such as transport and schools, and less deprived neighbourhoods8,9,10. Such a constellation of neighbourhood effects serves to create spatial housing sub-markets that perpetuate socio-economic and health inequalities11.

The financialization of housing has resulted in affordability crisis in cities across the globe12. Increasing house prices have been associated with rising income inequality in Organisation for Economic Co-operation and Development (OECD) countries, partly driven by an increase in housing demand from high earners13. Economic geographers argue that financialization has a key spatial dimension, which manifests at various geographic scales, from the global to the local14. Within large cities throughout Europe, evidence suggests that spatial polarisation in house prices is becoming more profound, driven by increases in housing values in high-value neighbourhoods15,16.

The boom-bust cycle of house prices is a key outcome of housing market financialization, and it was particularly severe in Spain. Between 1985 and 2006, the accumulated Spanish house price increase was 307%, encouraged by state-led economic promotion of home ownership and low interest rates17,18. House price inflation was comparatively higher than other European countries such as Italy (110%), France (127%) and Germany (11%)19. Years of economic growth were followed by a serious decline in house prices and a recession following the sudden bust of the market in 2008, with unemployment reaching 20% in 201020.

Within Spanish cities, there are often wide disparities in housing prices between neighbourhoods21. It is pertinent to understand how these differences change over time, particularly following shocks to the market such as economic crisis. However, monitoring the spatio-temporal dynamics of neighbourhood housing prices is often limited by a lack of open house price data with the required spatio-temporal granularity. We employ housing listings data to overcome this limitation.

From the 1950’s, the Spanish state promoted real estate ownership as a secure financial investment, home-ownership rates rose from 45% in 1950 to 85% in 200717. Mortgage indebtedness increased by twelve times over the same period, these mortgages were often given to low-income households17. Most of the increase happened from the 1990’s, when state-lead housing financialization was happening rapidly.

Widespread foreclosures were one of the catalysts for mass social unrest in Madrid in 2011, when the anti-austerity indignados movement mobilised22. Spain had the highest number of evictions of any European country; 378,693 evictions were ordered between 2008 and 2014; these foreclosures have worsened urban inequality and exacerbated segregation between neighbourhoods23. Financially vulnerable groups, such as young people and certain migrant groups, struggled to meet their housing needs whilst the stock of vacant properties increased24. Since the burst of the housing bubble in 2008, one of the main outcomes within Spanish cities has been growing segregation, precariousness, evictions, and housing displacement25.

A critical lack of social housing in Spain also increases pressures on affordability for low-income groups26. Social housing is provided by the so-called Vivienda de Protección Oficial, literally ‘officially protected housing’ (VPO), which provides a subsidy to public or private developers for the construction of homes27. These dwellings are then offered at a below-market price and have recently shifted from the majority for sale to rented properties. It is estimated that only 2.8% of the total housing stock in Spain is permanent social housing28. Moreover, after the 2008 global financial crisis, a lack of public housing was exacerbated by privatisation, in 2013, Madrid’s government sold 5000 socially rented dwellings to investment funds26.

The paper is structured as follows: The results, which explore the dynamics of house price inequality in Madrid, are presented in the following section. These results are discussed in relation to spatial polarisation and inequality in Section 3. The study area, methods and data are outlined in Section 4.

Results

Spatial housing market trends since the financial crisis

The following section is split into two parts according to the methods. The first section (2.1) applies the Gini and spatial Gini coefficient at annual intervals and multiple scales, to understand how inequality in housing prices is changing over time. The second section (2.2) explores the extent to which neighbourhood house prices exhibit spatial clustering, and identifies two distinct spatial clusters, or sub-markets, of high and low housing prices in Madrid.

We use the term housing inequality to refer to spatial disparities in housing values between geographic areas. Changes to house price inequality are analysed during two distinct periods, housing market bust and boom. From 2010 to 2015 the average house price declined in Madrid from €443,970 to €280,500 (Table 1). This period of housing price bust was a knock-on effect of the global financial crisis in 2007, which triggered a dramatic housing market crash Spain20. From 2016 until 2018 the downward trajectory reverses, and the average house price rises slightly each year, reaching €324,209 in 2018 (Table 1). Comparing how housing inequality changed during the bust and boom periods is an important contribution of the research.

Table 1 Gini coefficient (expressed as %) for house prices in Madrid at four hierarchical scales (2010–2019)

Housing price inequality and changes during boom and bust

The Gini has been applied to house prices at the dwelling (n = 872,119), neighbourhood (n = 2442, Supplementary Fig. 1), district (n = 131, Supplementary Fig. 2), and regional (n = 21, Supplementary Fig. 3) intra-urban scales.

The greatest housing inequality is observed at the dwelling level, peaking at 50.49 in 2016 (Table 1). Lower observed housing price inequality once the data are averaged across administrative geographies suggests that the aggregation masks some of the individual differences in housing prices. Of all scales considered, the regional level shows the largest increase in the Gini coefficient over the study period (6.93%), rising from 18.82% (2010) to 25.75% (2019). A substantial increase in the Gini coefficient at the regional scale suggests housing wealth is becoming more concentrated in certain regions of the city.

In fact, at all intra-urban scales the Gini increases over time, indicating an overall growth in house price inequality between areas of the city (Table 1). Similar trends are observed across scales, the Gini increases year on year between until 2015, peaking around 2016/2017; from which point the coefficient decreases. This evidences that house price inequality rose annually during housing market bust and then began to decrease during housing market boom (Table 1). We see a similar temporal trend when using other inequality statistics, the 20/20 ratio and Theil index (Supplementary Fig. 5). An increase in inequality whilst house prices are declining suggests the impact of the housing bust was not even across neighbourhoods, and resulted in an increase in spatial housing differentials between areas of Madrid.

Changes to the Gini coefficient are indicative of shifts in the house price distribution within the city. Figure 1 shows the neighbourhood house price distribution year on-year using a Kernel Density Estimation (KDE), which is essentially a smoothed histogram. Between 2010 and 2015 the distribution gradually changes from a symmetrical bell-shaped curve to a positive skew with a long tail to the right (Fig. 1). In 2010, most neighbourhoods were in the 5th housing price decile, and were priced around the mean housing value (€443,970), which is 10.5 times greater than the average yearly income in Madrid (€39,856) (INE, 2023). Between 2010 and 2015 an increasing number of neighbourhoods are in the cheapest price deciles (1–3), whilst a small number of neighbourhoods remain at the top of the distribution. Again, Fig. 1 supports the conclusion that the house price bust shifted the distribution of neighbourhood house prices.

Fig. 1
figure 1

Annual Kernel Density Estimation of the house price distribution between neighbourhoods in Madrid (2010–2019).

From 2016 until 2019, during housing market boom, the distribution becomes bimodal, with a peak in neighbourhoods at the bottom and top of the price distribution. The bimodal shape suggests that most neighbourhoods are polarised between high- or low-prices. Figure 1 indicates that there are divergent local housing mechanisms, which are creating these two distinct groups of property values at either end of the distribution. Additionally, these findings indicate that neighbourhoods in Madrid will be more polarised in housing prices by the end of the decade.

An increase in the Gini coefficient suggests housing wealth is becoming more unevenly distributed between neighbourhoods over time. To further measure whether this has resulted in increasing spatial inequality, we use the spatial Gini, which breaks down house price inequality into differences between nearby and distant neighbourhoods. Statistical significance (p value <0.01) of the spatial Gini decomposition over time indicates the strong spatial structure of house price inequality at the neighbourhood level (Fig. 2). The spatial Gini results were not statistically significant at larger geographies (regions and districts), therefore aggregating into larger geographies masks some key spatial variation in house price differentials.

Fig. 2: Spatial Gini Coefficient applied to housing prices in Madrid (2010–2019).
figure 2

a Near differences, b far differences, c significance.

Far differences, the price inequality between geographically distant neighbourhoods (Fig. 2), increases over the study period, rising until 2014 then plateauing until 2017, followed by slight decline until the end of the decade. The trend is similar to the standard Gini coefficient, thus suggesting that housing price inequality is driven mainly by inequalities between spatially distant neighbourhoods. Conversely, near differences decrease continuously over the study period (Fig. 2), indicating the increasing similarity of house prices of geographically proximate neighbourhoods. These findings suggest that there was more spatial inequality in housing prices by the end of the decade, and this worsened particularly during housing market bust.

Hot and cold house price clusters

The Moran’s I statistic indicates strong and increasing positive spatial autocorrelation in neighbourhood housing prices (Table 2), increasing from 0.5 in 2010 to 0.8 in 2019. The increase was steeper at the start of the decade, rising by 0.28 between 2010 and 2013, at which point the figure stabilises from 0.76–0.81. The increase in spatial autocorrelation suggests the spatial clustering of high and low neighbourhood housing prices is becoming more intense, particularly in the years after the financial crash. Increasing spatial autocorrelation in neighbourhood-level house prices is likely driving the increase in regional house price inequality identified from the Gini coefficient.

Table 2 The percentage of neighbourhoods in the hot, cold, and non-significant LISA house price groups for Madrid (2010–2019)

However, the Moran’s I coefficient doesn’t tell us where in Madrid spatial autocorrelation is present, and whether the autocorrelation is caused by clusters of high or low house prices. This is where a LISA analysis can be of use29 to measure the extent to which neighbourhoods cluster into spatially contingent groups of low and high house prices. The statistic is calculated for each year in the data to explore how house price clusters changed over time at the neighbourhood level. Table 2 shows annual changes in the percentage of neighbourhoods in each LISA cluster. Instances of negative spatial autocorrelation, where high- and low-priced neighbourhoods exist adjacent to one another, are not included as they represent <0.1% of total neighbourhoods. This indicates considerable spatial separation of high and low-priced areas and therefore income groups in Madrid.

The number of neighbourhoods in the non-significant LISA group (which exhibit no spatial autocorrelation) decreased by 10.3% over the decade, again indicating more intense spatial clustering in housing prices over time (Table 2). The number of neighbourhoods in the cold spot (Low–Low) increased by 9.1% between 2010 and 2012, a shift likely related to the housing market crash. The cold spot is the largest significant LISA group (Table 2), accounting for, on average, a third of neighbourhoods (n = 706) within Madrid. Overall, between 2010 and 2019 the number of neighbourhoods in the cold spot increased from 532 to 758. The number of neighbourhoods in the hot spot (High-High) also increased, although to a lesser extent by 3.3% (2010–2013). The hot spot includes 10% of neighbourhoods in Madrid (n = 270). Overall, the number of neighbourhoods in this group increases over the study period from 211 (2010) to 277 (2019). It was during the first three years of the study period (housing bust) that most of this change occurred.

The increase in the number of neighbourhoods that are part of the hot and cold spots, particularly the cold spot, suggests housing prices became more clustered into two polarised sub-markets over the study period (Fig. 3). One explanation of further clustering is that high and low housing values from the hot and cold spots are spilling over into nearby neighbourhoods. In fact, to the West of Madrid the central hotspots appear to be joining the other central hot spot, creating one larger hotspot in housing prices (Fig. 3).

Fig. 3: High-high and low-low LISA neighbourhood house price clusters in Madrid (2010–2019).
figure 3

Shade indicates the number of years in the data the neighbourhood is in the cluster.

The hot and cold spots are generally spatially polarised between centre and sub-urban areas. All the hotspots lie in Central and Northern regions of the city, the average property price in these areas was between €700,000 and €950,000. There is a persistent hot spot, a cluster of neighbourhoods that are consistently high-high across every year in the data, in the districts of Retiro, Salamanca, and Chamartin (Supplementary Fig. 3). These neighbourhoods fall along a main road from the centre to the North of the city centre. Houses here remain expensive throughout the fallout from the financial crisis.

Additionally, there are persistent hotspots in the regions of Moncloa-Aravaca and Chamberi. Northeastern regions, Barajas, Hortzaleza, and the northern area of Ciudad Lineal contain many neighbourhoods which are also hotspots. These neighbourhoods are characterised by high house prices, surrounded by similarly high-priced neighbourhoods. There are many offices in the Eastern regions of Madrid (Supplementary Fig. 4), indicating better access to medium and high-skilled employment for residents in the hot spot. In contrast, those living in the cheaper suburbs face longer and more expensive commute times to work in the city centre.

Conversely, the cold spot is located on the periphery of the city forming a half circle in the sub-urban South of Madrid, in regions such as Usera, Villaverde, Puente de Vellacas, and Carabanchel. The average house price in these neighbourhoods varies between €90,000 and €170,000. These areas are located nearby to industrial buildings on the outskirts of the city, which could be contributing to poorer environmental quality in the low-priced neighbourhoods (Supplementary Fig. 4). There are some smaller cold spots observed to the East and North of the city centre, in Ciudad Lineal and Tetuán. Despite representing a larger proportion of neighbourhoods, the cold spots appear more spatially fragmented than the hotspots. The location of these clusters may have notable implications for the local opportunities provided to residents, such as access to education, employment, and public transport, one way that local housing price dynamics contributes to socio-economic inequalities. The clusters identified could also reflect other income-related intra-urban inequalities, such as the digital divide30.

The hot and cold spots identified from the LISA analysis can be thought of as housing sub-markets, housing within these groups is statistically similar in price and location. We find stark inequality in the housing value held by the LISA groups. Using the property listings in the consistently hot and cold neighbourhoods throughout every year in the data, we find that the hot spot, which accounts for 26% of total housing listings, holds 53% of the total housing wealth. In contrast, properties in the cold spot account for 38% of the total listings, but hold just 16% of the total housing wealth. This shows the strong socio-spatial wealth inequality between the separate areas of the city, and stark wealth inequality between property owners in the hot and cold sub-markets.

Figure 4 shows the median house price (per m2) of the property listings in the hot and cold sub-markets. Both groups exhibit a decline in price (per m2) until 2014, from which point the average price gradually increases. However, there are key differences in the rate of house price change between the sub-markets. Between 2010 and 2014 the hot spot declined in price by 24%, whereas the cold spot felt a loss of 47%, suggesting that the bust period of the financial crisis was felt more acutely for properties at the lower end of the price distribution. After the boom period, we observe that the average price (per m2) in the hotspot was around €5000,~€1000 more expensive than in 2010. For the cold spot, the housing value was around €2300 (per m2) in 2019, €400 less than in 2010, suggesting recovery happened at a slower pace for the cold spot. These findings indicate the negative effect of the financial crisis on housing values was more intense for properties in the cold spot.

Fig. 4
figure 4

Temporal trend in the average house price (€) per m2 for properties in the hot and cold housing sub-markets (2010–2019).

Discussion

Our results indicate spatial house price differentials in Madrid became more unequal following the financial crisis. The increase in housing price inequality was particularly marked across the 21 regions of the city, although inequality increased at all geographic scales considered. Moreover, the analysis evidenced worsening spatial housing market polarisation; shown by an increase in the number of neighbourhoods in the hot and cold sub-markets. The spatial separation of the high and low sub-markets evidenced in this research reflects the broader segregation of the rich and poor, a gap that is growing in urban areas31. Strong polarisation in the housing market has been identified European cities since 200032. Our results suggest the worsening of this trend in Madrid since the financial crisis, particularly during the bust period, which may also be reflected in similar financialised urban housing markets across Europe.

It was during the period of housing bust (2010–2015) that inequality exhibited the strongest increases at every geographic scale, according to the Gini coefficient. House price inequality increased during the same period of housing market bust at national level in the Netherlands15. Our analysis evidences that housing market inequality is structural and worsens during and following housing market crashes at the local intra-urban level. Although, since 2017 we find that spatial inequality in housing prices began to fall. It will be important to monitor whether this trajectory continues over time, particularly during other economic shocks such as the COVID-19 pandemic. Evidence from the US suggests house price trends shifted spatially during Covid-19, with a preference for the city periphery33.

Although we did not formally test for a spillover effect, we see increasing global spatial autocorrelation, growth of the local house price clusters, and an increase in near differences as measured using the spatial Gini coefficient, as indicative of this kind of process. Other research has linked neighbourhood house price changes to a spillover effect, where the price change in one neighbourhood has a knock-on effect in adjacent neighbourhoods, causing price convergence at a wider geographic scale34,35. Further research is required to identify the driver(s) of increasing spatial inequality in house prices in this context.

The differences identified in the rate of house price change between the high- and low-priced sub-markets have important implications for socio-spatial wealth inequalities. Disparities in wealth accumulation exist between homeowners depending on where they own property. The wealth share of the top 10% has been found to increase during housing bust periods, partly because of the stability of wealth from large assets, such as housing36. Our findings support this and show that in the aftermath of the financial crisis, properties in the hot spot were more resilient to the bust of the market compared to the cold spot. This difference highlights the unequal impact of the financial crash across the housing price distribution, as well as emphasising how differences in housing appreciation rates intensify wealth inequalities over space and between income groups. Homeowners in the cold spot, who hold a much smaller percentage of housing wealth (16%), felt a larger drop in their asset’s value compared to those who own expensive property in the hotspot; which holds a shocking 53% of total housing wealth. In part, the hotspots resilience could be related to its location in the central region of Madrid. The evidence suggests that macroeconomic shocks, such as the housing bust, are a key mechanism for worsening local spatial inequalities between housing sub-markets.

In the US, research in Atlanta has shown that housing market recovery after the housing crisis varied according to neighbourhood type, with predominantly black and poor neighbourhoods experiencing the greatest long-term negative equity, while many white, middle, and upper-income areas more than recovered37. Exploring the socio-economic and population characteristics of the identified hot and cold sub-markets is a key direction of future research.

Also of interest is how the location of these sub-markets influences access to important amenities such as public services, employment, and transport. The most persistent hot spot is located in Madrid’s centre, which has better access to urban amenities, office employment, and public services (Supplementary Fig. 4). There is a clear lack of affordable housing in the city centre; lower-income residents will be excluded from inner-city neighbourhoods due to the high cost of home ownership, pushing these residents to live in the outer suburbs5. Considering inequality in accessibility would help unpack how local and spatial housing price patterns drive broader social and economic inequalities between homeowners of varied affluence. Additionally, it is essential for future research to explore similar trends in the rental market38. A rise in renting is a key outcome of housing financialisation and this study considered inequality between homeowners.

Overall, spatial polarisation and segregation of hot and cold housing sub-markets are key features of Madrid’s housing market. The polarisation of housing prices is a tangible manifestation of rising socio-economic segregation and spatial inequality. High socio-economic segregation in cities threatens social cohesion39 and perpetuates poverty and deprivation40. Between 2001 and 2011, evidence showed that mixed-income residential areas in Madrid disappeared24. This trend seems to have persisted, supported by the study’s finding of very few instances of negative spatial autocorrelation (high and low-priced neighbourhoods existing adjacent to one another). If the identified trends continue Madrid will remain one of the most segregated European cities between socio-economic groups.

Urban socio-spatial inequalities manifest across multiple dimensions and depend on the local historic structure41. This paper has shown that, where available, housing listings data can be used to monitor local housing price dynamics over space and time. These changes are a valuable way to evidence 21st-century urban spatial inequalities. It is important that policies to encourage equal access to home ownership are implemented across the city, to ensure the development of an equitable housing market and to minimise the wealth gap between income groups. It is critical that the local government works to provide good social housing and more affordable housing options in the central neighbourhoods of Madrid. Ensuring access to affordable housing is essential to ensure the sustainable growth of cities, and prevent the further sub-urbanisation of poverty and increases in residential segregation. Additionally, policy initiatives should work to ensure public services are more evenly distributed, to try and minimise the negative impact of spatial house price inequality on access to services for lower-income populations. Initiatives such as the 15-minute city could be beneficial for this agenda.

Methods

Study area

The City of Madrid (604.3 km2) is a densely populated urban area, with a population of 3.2 million people and a housing stock of 384,364 residential buildings42. Madrid is a major European city, financial and cultural centre. Large cities have structurally higher inequalities than smaller ones, due to the varied affluence of the population43. Madrid’s housing market has a monocentric structure, characterised by very high house prices in the city centre (Supplementary Fig. 2).

The city of Madrid underwent dramatic transformations to its socio-spatial structure at the start of the 21st century; real estate was identified as a driver of segregation44. It is recognised that the evolution of house prices particularly changed the spatial distribution of social groups in Madrid45. Residential areas with a mix of socio-economic groups have decreased, creating more spatial inequality20,46.

Between 2001 and 2011, Madrid became one of the most segregated European cities based on occupation, with marked income inequality32. It has been suggested that the most vulnerable population groups have been displaced to sub-urban areas with poor access to services, such as education, health, and leisure21. The centrality of the housing system to social and political issues and changing patterns of spatial segregation in Madrid make it an important case study.

Inequality indicators

A quantitative, exploratory, and spatial approach is adopted to measure house price inequality over time in Madrid. The Gini Coefficient, pioneered by Lorenz47 and Gini48, is a widely cited statistical measure of dispersion. It is commonly used within economics to measure how equally wealth or income is shared among a population49. The Gini statistic ranges from 0 to 1 but is often presented as a percentage (0 to 100). A Gini of 0 indicates perfect equality, where every observation in the dataset has the same value or wealth. Conversely, a value of 1 would reflect complete inequality, where one observation holds all the wealth. A few studies have applied the Gini index to house prices15,50. The Gini coefficient is used to assess the amount of inequality in the dispersion of house prices between geographic areas, and how this is changing over time.

The Gini is usually used to assess the distribution of income across a population, but when observations represent geographic units, the spatial dimension is not accounted for by this measure. Very different geographic distributions of a variable would result in the same Gini coefficient; it is aspatial. One of the main objectives of this research is to understand the spatial structure and patterns of inequality in housing values, and how this is changing over time.

Thus, in combination with the traditional Gini, we use a spatial decomposition of the Gini coefficient, which also considers spatial autocorrelation51. The measure breaks down inequality into ‘near differences’, inequality between spatially adjacent neighbourhoods, and ‘far differences’, inequality between areas geographically distant from one another. If nearby neighbourhoods are similar in price, the near differences coefficient will be small. Alternatively, if the difference between the price of spatially distant neighbourhoods is small, the far differences coefficient will be small. Near and far neighbours are defined on rook contiguity spatial weights, which consider areas as neighbours if they share a common edge52. These are discussed further in the following section. The applications of the spatial Gini are mainly in the context of income inequality53 and economic inequality54. To the best of our knowledge, we are the first study to apply this decomposition of the Gini coefficient to housing prices.

LISA analysis

Spatial autocorrelation is a central concept within spatial statistics, it describes how values are distributed across space55. The presence of spatial autocorrelation means there is a systematic spatial pattern to the distribution of values. No spatial autocorrelation in a variable means its spatial dispersion is random and geography does not play a role in the production of values. House prices generally exhibit positive spatial autocorrelation; houses with similar values are found near to one another, since they share locational characteristics56. Measuring spatial autocorrelation requires a mathematical representation of the data’s spatial structure. We employ a spatial weights matrix which quantifies the spatial configuration of areas, considering their proximity and adjacency to one another. For the LISA calculations and the spatial Gini coefficient, the study uses rook contiguity-based weights, which requires that the pair of polygons share an edge of their boundary to be considered neighbours52. This was chosen as all the areas have a neighbour according to the weight definition, but it does not consider neighbourhoods that share a vertex as neighbours, which a queen weights definition would, making it more selective.

The Moran’s I statistic is a global measure of spatial autocorrelation57. The statistic summarises the direction and strength of spatial autocorrelation (−1 to 1). A value of 1 equates to the strongest case of positive spatial autocorrelation, where similar values are found nearby to one another. Alternatively, a value of −1 would indicate that dissimilar values are strongly clustered together in space (negative spatial autocorrelation). A score of 0 indicates a random spatial pattern. Whilst the Moran’s I statistic is useful to understand the strength and direction of spatial autocorrelation in a variable across the whole map, we are interested in identifying specific local clusters of positive and negative autocorrelation. To do so, we use the LISA statistic29. For each geographic unit, a LISA tells us the type of spatial relationship in housing price the area exhibits with its neighbours, as well as an assessment of significance.

There are five possible LISA groups: Low-Low and High-High (positive spatial clustering of low or high housing values). These are also known as cold and hotspots, respectively. Alternatively, Low-High and High-Low groups include instances of negative spatial autocorrelation, where high and low house prices cluster together. Non-significant is the final group which indicates no significant spatial autocorrelation in the distribution of values. LISA statistics are useful for identifying clusters in the spatial arrangement of a variable, they have commonly been applied to house prices58,59.

Availability of data

Listings data

Online real estate platforms have become a popular and efficient means to rent, buy, and sell properties. Homeowners or agents upload photos and descriptions of properties to the site, and buyers can browse these property advertisements. A byproduct of this service is the creation of rich, spatially extensive, real-time data about the property market. These data are fairly new and have so far been used in housing market research for house price prediction60 and reporting the dynamics of the rental market61,62. To measure changes to the spatial housing market structure, we use data from Idealista (https://www.idealista.com/), the leading real estate advertisement portal operating in Spain.

The dataset comprises 872,016 listings posted on the site in the metropolitan area of Madrid (2010–2019). The listing price (in Euros) is the key variable for the study, provided at the individual level. We also use the time stamp (the year and quarter the property was advertised) for measuring price dynamics across time. Previously, data on the housing market were not available at such a high spatial and temporal resolution. Traditional census sources and house price indicators are aggregated across space and time, which limits their ability to monitor space-time housing price trends at the micro-scale.

Although the final sale price would be the most accurate indicator of housing values, this data is not openly available in our study area. We, therefore, use listing prices, which represent the value of housing on the market. Research has shown that the listing price is typically strongly correlated with the final sale price63. Using Idealista data and registered closing prices, it has been estimated that the average discount from asking to closing price ranges between 5% and 13.8% in Madrid between 2010 and 201864. For our analysis, this means that some house prices may be overestimated by up to 13.8%. However, a non-trivial number of listings generally have the same asking and final price63.

As Idealista has a monopoly in Madrid for online property advertisement, we conclude that our data encompasses most of the housing market supply, but not the total residential housing stock. Listings that did not sell and remained in the portal for over 3 months with the same price, were removed (n = 10,455). We retain listings that stayed in the portal but exhibited a price change (n = 278,991), as we see these as indicative of market price trends over time. We cannot identify properties that are removed from the site and re-posted, but expect these to have little influence on the results, as properties are generally kept in the portal if they do not sell, and then the price is lowered. The results therefore represent changes to the value of properties on the market, with repeated adverts indicating less demand in a certain sub-market.

The annual variation in the number of listings is a function of temporal differences in market supply and the popularity of Idealista. It is an inherent characteristic of the listings data and the housing market. The annual number of listings ranges from 11,063 to 88,568 (Table 1). We see the fewest listings in 2010, which is likely because Idealista was less popular in its early years. We retain all years despite the variation in observations, as removing 2010 does not affect the main conclusions of the paper. Temporal variation in the housing supply is also an inherent characteristic of the housing market.

Geographic boundary data

Partitioning extensive housing markets into smaller sub-markets is a common way to structure and conceptualise residential data. Housing prices are spatially dependent, and similar properties tend to be found nearby to one another. Sub-markets are generally based on property characteristics, housing values, and underlying geography65. The aggregation of micro-level individual data into spatial units is germane to the study of spatial differences in housing and inequality66. The analysis uses three hierarchical scales of geographic aggregation: 21 regions (Supplementary Fig. 3), 131 districts (Supplementary Fig. 2), and 2442 neighbourhoods (Supplementary Fig. 1). These scales are used to build a wider picture of house price inequality in local levels. The modifiable area unit problem (MAUP) is a form of statistical bias that occurs when aggregating individual data into spatial units67. The spatial patterns of the variable, once aggregated are dependent upon two conditions. The scale of the enumeration units (scale effect), and the way that the boundaries are drawn (zonation effect)68,69.

Administrative boundaries are published openly by Madrid City Council, and can be found on the government data portal70,71,72, the Spanish statistical office. The neighbourhood level (Secciones Censales) is the most granular geographic aggregation unit available. The neighbourhoods, or sections, are created using the census, each area has a similar residential population counts of around 2500 people. This makes the boundaries useful to define housing sub-markets as there is some consistency between the areas in terms of the number of residents. Furthermore, the sections are used by government to aggregate census population data. For the findings of this study to be related to patterns of residential segregation and to potentially inform local housing policies, it is important to use the same geographic boundaries to aggregate the data.

Reporting summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.