Purpose

The purpose of this project is to track a variety of trends over time involving data on the global housing market from 2015-2024. This can help people choose a good place to live, and also have a rough estimate of what the future of the housing markets in these countries might look like. The target audience is anyone who is looking to settle down, such as retirees looking for a vacation home or families who want an affordable place to live. Some findings this analysis might yield include are how affordability of housing has evolved across these countries, or correlations between factors such as inflation and house price index and how these might affect the market in the future.

Bar Plot on Average Housing Affordability Ratios

This bar chart shows the average housing affordability ratio for each country between 2015 and 2024. The affordability ratio is calculated as the House Price Index divided by Rent Index, meaning higher values indicate housing is less affordable relative to rent. Countries like Russia, South Africa, and the UK show the highest average affordability ratios, suggesting that home prices are significantly higher relative to rent — a potential signal of housing market strain. In contrast, countries like Brazil, Australia, and Japan exhibit lower ratios, indicating relatively more affordable housing markets. This measure is valuable for assessing long-term housing accessibility and can inform decisions for individuals planning to buy versus rent, as well as policy discussions on housing affordability.

Violin Plot on HPI from 2015-2024

This violin plot illustrates the distribution of House Price Index values for each country from 2015 to 2024. Wider sections represent years with more frequent HPI values, while narrow points indicate less common levels. This plot captures both the range and density of housing prices, allowing for better comparison of price variability across countries. Countries with a wider spread (like the UK or USA) may have more volatile housing markets, while those with tight, symmetrical shapes suggest more stable pricing trends over time.

Code for 3D Scatter Plot

housing_data <- read.csv("housingMarket.csv")
colnames(housing_data) <- make.names(colnames(housing_data))
custom_colors <- viridis::viridis(length(unique(housing_data$Country)))

plot_ly(housing_data,
        x = ~House.Price.Index,
        y = ~Inflation.Rate....,
        z = ~GDP.Growth....,
        color = ~Country,
        colors = custom_colors,
        type = "scatter3d",
        mode = "markers") %>%
  layout(title = "3D Scatter: HPI vs Inflation vs GDP Growth",
         scene = list(
           xaxis = list(title = "House Price Index"),
           yaxis = list(title = "Inflation Rate (%)"),
           zaxis = list(title = "GDP Growth (%)")
         ))

This code generates a 3D scatterplot using the plotly library to visualize the relationship between House Price Index, Inflation Rate, and GDP Growth across countries. The use of make.names() ensures all column names are R-safe, while the viridis color palette handles many unique country values without generating warnings. This plot is important because it satisfies the project’s 3-variable and 3D requirements, and provides a clear visual of economic indicators that may influence housing markets.

Scatter Plot on HPI, Inflation Rate, and GDP Growth

This scatter plot shows the relationship between House Price Index, Inflation Rate, and GDP Growth globally from 2015 to 2024. Each point represents a specific country-year combination, color-coded by country. Countries with high inflation rates often experienced a notable rise in housing prices, demonstrating that inflation may contribute to increasing housing costs. Conversely, GDP growth varied independently, suggesting that a significant change in economy does not necessarily affect inflation or home prices. This graph is important because it helps reveal potential economic imbalances or housing bubbles, situations in which house prices rise faster than inflation or GDP growth. This insight can be useful for policy makers, economists, or real estate agents trying to conduct risk management.

Box Plot on Rent Index from 2015-2024

This box plot shows the distribution of the Rent Index across countries from 2015 to 2024. Each box represents the spread of rent values for that country, showing the median, interquartile range, and any outliers. Countries with wider boxes or longer whiskers indicate more variability in rent prices over time, while narrower boxes reflect more stable rental markets. For example, countries like Germany and France show relatively consistent rent values, whereas others like South Korea or the UK exhibit greater fluctuations. Understanding rent distribution helps identify housing market stability and can inform decisions for renters, investors, and policymakers about where rental markets may be more predictable or volatile.

Statistical Analysis

Summary Statistics: Rent Index by Country
Country Min_Rent Q1_Rent Median_Rent Q3_Rent Max_Rent Mean_Rent SD_Rent
Australia 51.40 58.38 72.13 87.95 112.66 75.27 20.43
Brazil 52.95 75.15 88.69 106.50 119.86 88.80 22.17
Canada 52.20 63.00 86.91 107.67 119.00 86.15 25.32
China 51.78 63.38 89.91 107.64 119.78 86.59 25.20
France 54.03 60.24 76.72 81.05 102.54 75.03 16.14
Germany 53.22 79.06 92.48 100.27 112.30 88.66 17.71
India 60.49 62.69 81.86 92.19 113.45 81.11 19.18
Italy 53.17 63.45 89.97 115.31 119.76 88.64 26.57
Japan 51.86 59.64 67.63 87.70 114.00 74.04 19.97
Mexico 55.77 84.58 97.59 107.47 118.68 93.28 22.09
Netherlands 51.28 75.11 81.27 96.61 110.95 82.88 19.45
Russia 59.16 68.76 81.69 86.44 113.87 80.05 16.19
South Africa 52.32 87.45 99.32 109.54 119.74 94.29 23.33
South Korea 55.33 59.37 73.98 98.44 115.99 80.81 23.29
Spain 55.31 62.82 84.79 93.17 114.86 82.90 21.87
Sweden 51.65 63.38 90.02 98.31 108.79 82.62 20.51
Switzerland 54.21 61.33 71.36 95.16 114.89 77.54 21.69
UAE 54.29 69.32 80.80 94.22 117.17 82.67 20.09
UK 50.35 56.87 66.00 101.83 118.11 77.34 26.09
USA 51.44 69.85 72.49 103.18 116.55 82.29 23.58
## Correlation between Rent Index and Affordability Ratio: -0.053

This slide presents detailed summary statistics for the Rent Index by country from 2015 to 2024. The table includes each country’s 5-number summary (minimum, 1st quartile, median, 3rd quartile, maximum), along with the mean and standard deviation. Countries like South Africa and Mexico have some of the highest average and upper-range rent values, while Japan and France remain among the more affordable with lower median and maximum rents. Countries such as Germany and Italy show relatively stable rent levels, reflected by tighter interquartile ranges and lower standard deviations. A correlation analysis between Rent Index and Affordability Ratio reveals a slightly negative relationship, suggesting that higher rents do not always directly correspond to lower housing affordability across countries in this dataset.

Conclusion

This project delved into multiple analyses of the global housing market from 2015 to 2024 using ggplot2 and plotly visualizations. By examining key variables such as the House Price Index, Rent Index, Affordability Ratio, and macro indicators like inflation and GDP growth, we were able to uncover meaningful patterns and country-specific trends.For example, the plots revealed how affordability varies widely across countries, with some markets (e.g., UK, USA, South Africa) experiencing consistently high prices relative to rent. Interactive visualizations allowed for deeper exploration of economic dynamics affecting the housing sector. Additionally, the statistical analysis displayed a weak correlation between rent and affordability, demonstrating that housing costs are the result of multiple different factors, rather than just rent. These analyses can help prospective home-buyers make more informed decisions about where to settle by highlighting long-term affordability and economic stability in certain countries. Future research could also incorporate wage data or tax incentives for more detailed insight into housing market accessibility.