Trend in Housing Market in India

The data for the plot is sourced from FRED using the tidyquant package in R and the plot is generated using the ggplot2 package in R.

House Prices in India

The following R code is partly sourced from http://lenkiefer.com/. The Bank of International Settlement (BIS) also provides resources on detailing the methodology used to construct the house price index for various countries. Please note that the National Housing Bank also generates a similar index called NHB RESIDEX  which is more granular i.e. at city level.

 
#############################################
# Load the necessary Libraries
##############################################
library(tidyquant)
library(ggplot2)
library(dplyr)
#############################################
# import the data from FRED
##############################################
hp.ind <- tq_get("QINN628BIS", get = "economic.data") %>% 
          tq_mutate(select = price, mutate_fun = periodReturn,
                    col_rename = "grwth")
           
#############################################
# Generate the Plot in R using ggplot
##############################################
ggplot(hp.ind, aes(x=date, y = 100*(grwth)))+
               geom_line(color="darkorange3", lwd=1)+
               geom_text(data=hp.ind %>% filter(date==max(hp.ind$date)),
                         aes(label=paste(round(100*(grwth),2),"%", sep="")), 
                          nudge_y=0.01,fontface="bold",color="black") +
               scale_x_date(limits = c(as.Date("2009-01-01"),as.Date("2017-07-01")),
                             date_breaks = "1 year",date_labels="%Y")+
               labs(x="",y="Growth in House Price in India (%)",
                    
                   title="Quarterly growth in house price from Jan 2009 to July 2017",
                   subtitle="https://atmajitgohil.com/",
                   caption="Source:Bank for International Settlements, \nResidential Property Prices for India [QINN628BIS], retrieved from FRED, Federal Reserve Bank of St. Louis; \nhttps://fred.stlouisfed.org/series/QINN628BIS, April 19, 2018")+
               theme(plot.subtitle=element_text(face="italic",size=10),
                    plot.title=element_text(color="cadetblue4",size=16),
                    plot.caption=element_text(hjust=0))




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

WordPress.com.

Up ↑

%d bloggers like this: