* * Examples 17.3 from page 489, 17.4 from page 494, 17.5 from page 494, and from * summary on page 501 * cal(q) 1947 open data gnptbill.txt data(format=prn,org=obs) 1947:1 1989:1 * * Direct calculations for 17.3 * linreg tbill # tbill{1} disp "T(p-1)=" %nobs*(%beta(1)-1) disp "TTest=" (%beta(1)-1)/%stderrs(1) * * Using the procedure. The default for @DFUNIT is to include an intercept but no * trend. To get the test without an intercept in the regression, use the * DET=NONE option. (DET is short for deterministic). * @dfunit(det=none,nottest) tbill @dfunit(det=none,ttest) tbill * * Direct calculations for 17.4 * linreg tbill # constant tbill{1} disp "T(p-1)=" %nobs*(%beta(2)-1) disp "TTest=" (%beta(2)-1)/%stderrs(2) * * Using the procedure * @dfunit(nottest) tbill @dfunit(ttest) tbill * * Example 17.5-joint test * linreg tbill # constant tbill{1} * * This computes the joint F-test. We suppress the printing, because it will give * a misleading p-value, based upon an F and not the non-standard distribution. * test(noprint) # 1 2 # 0.0 1.0 disp "Joint test of p=1, and intercept=0" %cdstat * * graph(footer="Figure 17.2 U.S. Nominal Interest Rate on 3-month Treasury Bills") # tbill * * GNP example from page 501 * graph(footer="Figure 17.3 U.S. Real GNP") # gnp set lgnp = 100.0*log(gnp) set trend = t linreg lgnp # constant lgnp{1} trend * disp "T(p-1)=" %nobs*(%beta(2)-1) disp "Ttest=" (%beta(2)-1)/%stderrs(2) test(noprint) # 2 3 # 1.0 0.0 disp "Joint test of p=1 and trend=0" %cdstat * * Using the procedure * @dfunit(det=trend,nottest) lgnp @dfunit(det=trend,ttest) lgnp