* * Martin, Hurn, Harris, "Econometric Modelling with Time Series" * Example 16.1, 16.3, from pp 584-587 * Nelson-Plosser data * open data nelson_plosser.mat calendar(a) 1860:1 data(format=matlab,sheet="data",missing=0.0) 1860:01 1970:01 date rgnp gnp pcrgnp ip emp un prgnp \$ cpi wg rwg m vel bnd sp500 * dofor y = rgnp gnp pcrgnp ip emp un prgnp cpi wg rwg m vel sp500 log y end dofor y * set dettrend = .1+.2*t+%ran(1.0) set(first=0.0) sttrend = .3+sttrend{1}+%ran(1.0) graph # dettrend * dec hash[string] ln compute ln("rgnp")="Real GNP" compute ln("gnp")="Nominal GNP" compute ln("pcrgnp")="Real GNP(per capita)" compute ln("ip")="Industrial production" compute ln("emp")="Employment" compute ln("un")="Unemployment" compute ln("prgnp")="GNP Deflator" compute ln("cpi")="CPI" compute ln("wg")="Wages" compute ln("rwg")="Real wages" compute ln("m")="Money stock" compute ln("vel")="Velocity" compute ln("bnd")="Bond yield" compute ln("sp500")="Stock price" compute ln("dettrend")="Det. trend" compute ln("sttrend")="Random walk" * spgraph(vfields=4,hfields=4,fillby=rows,footer="Figure 16.1 US annual macroeconomics variables") dofor y = rgnp to sp500 dettrend sttrend graph(header=ln(%l(y))) # y end dofor y spgraph(done) * set trend = t*.01 * dofor y = rgnp to sp500 dettrend sttrend disp ln(%l(y)) linreg(noprint) y # constant trend disp %beta linreg(noprint) y # constant y{1} disp %beta linreg(noprint) y # constant trend y{1} disp %beta end dofor y