Given the following model which relates the full year home sales to the unemployment rate (observed or estimated) I get a projected increase of 14% for 2013 over 2012... last year the same approach over projected by 6% (the 2012 projection was for 41,992 and the actual is coming in about 39,535) So I think the model is over projecting but I'm at a dead end thinking of a good (valid) way to modify it? BTW the projection)s) is identical to what a simple straight line regression in a spreadsheet yields.
I want to also thank the fine people at Stack overflow who got me this far in my 1st foray into R http://stackoverflow.com/questions/14032768/csv-input-to-r-forecast-with-dates-via-r-studio#14032768
Pointers appreciated.
# load the base data as presented in the question
Workbook1 <- structure(list(Year = structure(1:10, .Label = c("31-Dec-04",
"31-Dec-05", "31-Dec-06", "31-Dec-07", "31-Dec-08", "31-Dec-09",
"31-Dec-10", "31-Dec-11", "31-Dec-12", "31-Dec-13"), class = "factor"),
total = c(51439L, 59674L, 58664L, 55698L, 42235L, 37918L,
36234L, 36965L, 39535L, NA), UnemplRt = c(5.7, 4.7, 3.8,
3.7, 4.3, 8.5, 10.9, 10, 8.3, 7.1)), .Names = c("Year", "total",
"UnemplRt"), class = "data.frame", row.names = c(NA, -10L))
# Make a time series out of the value
dependent <- ts(Workbook1[1:9,]$total, start=c(2004), frequency=1)
# load forecast package
require(forecast)
# load independent variables in variables.
unemployment <- ts(Workbook1[1:9,]$UnemplRt, start=c(2004), frequency=1)
unemployment_future <- ts(Workbook1[10:10,]$UnemplRt, start=c(2004), frequency=1)
# make a model that fits the history
fit2 <- auto.arima(dependent, xreg=unemployment)
# generate a forecast with the already known unemployment rate for 2013.
fcast2 <- forecast(fit2,xreg=unemployment_future)
fcast2
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
2013 45168.02 38848.92 51487.12 35503.79 54832.25
This yield exactly the same result a a simple spreadsheet liniear regression. And I belive the suggested increase in home sales is too high, last year the projection turned out to be about 6% too high. So I'm trying to torture the numbers in some statically valid method to come up with a somewhat lower number for 2013
