# The housing bubble: Where are we?

July 25, 2012
By

(This article was first published on Decision Science News » R, and kindly contributed to R-bloggers)

DIFFERENT CITIES TELL DIFFERENT STORIES

Last spring we looked at the state of the housing bubble in the US. The question on readers’ minds then was “where is it going next”? Since Decision Science News is looking for a place to buy, it is on our minds as well.

It’s been more than a year, so let’s have a look. Above, we see the plot for all cities. We realize the colors are hard to follow, so if you want to track your city, download the spreadsheet.

In January 2011, the average index value across the cities represented here was 127, in April 2012 (the latest data we have) it was 124. The “composite 10″ score in January 2011 was 154, it went to 148. Similarity the “composite 20″ value went from 141 to 136. So, things have continued to drop a bit.

All depends on the local market, however. This is an Olympic year, so we really should highlight a few exceptional stories (the same ones we profiled in 2011):

Want to reproduce these graphs yourself? Go right ahead! Here’s the code. Plots are made with R and Hadley Wickham‘s ggplot2.

``` library(ggplot2) library(reshape) ## Read in data, available from: #www.standardandpoors.com/indices/sp-case-shiller-home-price-indices/en/us/?indexId=spusa-cashpidff--p-us---- #Delete the 2nd row and make 1st col 1st row say YEAR dat=read.csv("CSHomePrice_History.csv") mdf=melt(dat,id.vars="YEAR") mdf\$Date=as.Date(paste("01-",mdf\$YEAR,sep=""),"%d-%b-%y") names(mdf)=c("MonthYear","City","IndexValue","Date") mdf\$yr=format(mdf\$Date,"%Y") mdf=subset(mdf,yr>1999) ggplot(data=mdf,aes(x=Date,y=IndexValue)) + geom_line(aes(color=City),size=1.25) + scale_x_date("Year", minor_breaks="years") + scale_y_continuous("Case Schiller Index") sm=subset(mdf,City %in% c('NY.New.York','FL.Miami','CA.Los Angeles','MI.Detroit', 'TX.Dallas','IL.Chicago','DC.Washington')) sm\$City=droplevels(sm\$City) ggplot(data=sm,aes(x=Date,y=IndexValue)) + geom_line(aes(color=City),size=1.5) + scale_x_date("Year", minor_breaks="years") + scale_y_continuous("Case Schiller Index") ```

The post The housing bubble: Where are we? appeared first on Decision Science News.

To leave a comment for the author, please follow the link and comment on their blog: Decision Science News » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

## Sponsors

Contact us if you wish to help support R-bloggers, and place your banner here.

# Never miss an update! Subscribe to R-bloggers to receive e-mails with the latest R posts.(You will not see this message again.)

Click here to close (This popup will not appear again)