* * File = regression1.prg * First, change the default directory (Choose File - Directory - .. ). * ; * Anything after "*" is treated as * comments. cal 1960 1 4 ; * Set calendar for quarterly data ; * beginning with 60:1 all 200 1991:4 ; * and ending 91:4. ; * Allocate space for 200 series ; * ";" is needed when two commands ; * appear in one line * Reading data files open data us.prn ; * Data set is assumed to be on ; * the default directory data(format=prn,org=obs) / m1 gdpdef tbill govt close data print / m1 tbill * Data transformation set gm1 = log(m1) - log(m1{1}) set inf = log(gdpdef) - log(gdpdef{1}) log m1 / lm1 diff tbill / dtbill set trend = t print / m1 gm1 lm1 tbill dtbill trend statistics m1 ; * descriptive statistics table / m1 gm1 lm1 tbill dtbill ; * create summary statistics * Plot of the data graph(header='Plot of Tbill Rates and First difference', $ key=upleft, patterns) 2 # tbill # dtbill * Regression linreg inf / res1 ; * dep = inf, save residuals = res1 # constant trend gm1 dtbill ; * Independent variable: gm1 dtbill linreg inf / res2 ; * dep = inf, save residuals = res1 # constant trend inf{1 to 3} gm1 dtbill ; * Ind variables: inf(-1) gm1 dtbill seasonal season4 print / season4 linreg inf / res3 ; * dep = inf, save residuals = res1 # constant trend season4{-3 to -1} inf{1 to 3} gm1 dtbill ; * Seasonal dummies are added. * Restriction tests exclude # season4{-3 to -1} test # 3 4 5 # 0 0 0 test # 2 # 0 exclude # inf{1 to 3} exclude # season4{-3 to -1}inf{1 to 3} * Note: Using 4 dummies and omitting the constant term leads to * the same result. linreg inf / res3 ; * dep = inf, save residuals = res3 # trend season4{-3 to 0} inf{1 to 3} gm1 dtbill ; * More Graphs prj EST ; * save the predicted values into "EST" graph(key=upleft,style=symbols,patterns, $ header='Estimated and Residual Values of dlwpi') 3 # EST # res3 # inf