This project aims to demonstrate the cost of real estate and quality of life among cities in the world.
Data comes from:
https://www.numbeo.com/property-investment/rankings_current.jsp
https://www.numbeo.com/quality-of-life/rankings_current.jsp
Price to Income Ratio is the basic measure for apartment purchase affordability (lower is better). It is generally calculated as the ratio of median apartment prices to median familial disposable income, expressed as years of income (although variations are used also elsewhere).
Our formula assumes and uses:
- net disposable family income, as defined as 1.5 * the average net salary (50% is assumed percentage of women in the workforce) - median apartment size is 90 square meters - price per square meter (the formula uses) is the average price of square meter in the city center and outside of the city center
The size of the circle represents the value of the price to index ratio. A bigger circle means higher price of house relative to the income of citizens
library(leaflet)
top1 <- read.csv("top 10 lowest price income index.csv")
my_map <- top1 %>%
leaflet() %>%
addTiles() %>%
addMarkers(lng = top1$lng, lat = top1$lat) %>%
addCircles(weight=1,radius=sqrt(top1$Price.To.Income.Ratio)*200000)
## Assuming "lng" and "lat" are longitude and latitude, respectively
my_map
library(ggplot2)
ggplot(data = top1, mapping = aes(x = reorder(City, -Price.To.Income.Ratio),
y = Price.To.Income.Ratio)) +
geom_bar(stat="identity", fill = "deepskyblue") +
theme(axis.text.x = element_text(angle = 300, hjust = 0.3, vjust = 0.5)) +
ggtitle("Top 10 cities with the highest Property to Income Ratio") +
labs(x = "City", y="Property to Income Ratio")
The city with with the most expensive property is Caracas, nearly three times the second, Hong Kong,China. Besides, China contributes four cities to the top 10: Hong Kong, Shanghai, Beijing and Shenzhen. The rest are Mumbai, Colombo, Kathmandu, Algiers and Rio de Janeiro.
Quality of Life Index (higher is better) is an estimation of overall quality of life by using an empirical formula which takes into account purchasing power index (higher is better), pollution index (lower is better), house price to income ratio (lower is better), cost of living index (lower is better), safety index (higher is better), health care index (higher is better), traffic commute time index (lower is better) and climate index (higher is better).
Current formula (written in Java programming language):
index.main = Math.max(0, 100 + purchasingPowerInclRentIndex / 2.5 - (housePriceToIncomeRatio * 1.0) - costOfLivingIndex / 10 + safetyIndex / 2.0 + healthIndex / 2.5 - trafficTimeIndex / 2.0 - pollutionIndex * 2.0 / 3.0 + climateIndex / 3.0);
top2 <- read.csv("top 10 lowest life quality index.csv")
my_map2 <- top2 %>%
leaflet() %>%
addTiles() %>%
addMarkers(lng = top2$lng, lat = top2$lat) %>%
addCircles(weight = 1, radius= sqrt(top2$Quality.of.Life.Index)*200000)
## Assuming "lng" and "lat" are longitude and latitude, respectively
my_map2
library(ggplot2)
ggplot(data = top2, mapping = aes(x = reorder(City, Quality.of.Life.Index),
y = Quality.of.Life.Index)) +
geom_bar(stat="identity", fill = "deepskyblue") +
theme(axis.text.x = element_text(angle = 300, hjust = 0.3, vjust = 0.5)) +
ggtitle("Top 10 cities with the lowest Quality of Life Index") +
labs(x = "City", y="Quality of Life Index")
Again, Caracas is the worst with the lowest Quality of Life Index. China still contributes two cities which respectively serve as the political and economic center of China.
All cities appearred comes from developing countries and most of them belong to South-east Asian and South America. China, the world’s largest developing country, contributes four countries to the list.
Caracas, Venezuela is the worst in both lists. Venezuela is awash with natural resources. Its petroleum storage is the top1 in the world even larger than Kingdom of Saudi Arabia. Besides, Venezuela has rich resources of gold, nickel, iron ore, steel, diamond, alumina, coal, bauxite, asphalt, natural gas. A country that received so many gifts from God and has heavenly conditions is now so close to hell.