2016年7月7日木曜日

how to convert GDP to monthly basis.

GDP data is available only for quarterly basis, while other economical data such as payroll, retail and house constructions are monthly. Use approx to convert quaterly data to monthly. this is quite unorthodox, though. the command below will add 2 iterations  between the quarter and the next one, thus convert to monthly basis. Vector length is automatically calculated and adjusted.

last(GDP_XTS);GDP_XTS <- as.xts(read.zoo(data.frame(date=seq(index(first(GDPC96)),index(last(GDPC96)),by="months"),GDP=approx(GDPC96,n=(length(GDPC96)*3-2))$y)))

0 件のコメント: