* * Example 6.1 * pages 98-99 * open data tablef5-1[1].txt calendar(q) 1950 data(format=prn,org=columns) 1950:1 2000:4 year qtr realgdp realcons realinvs realgovt realdpi $ cpi_u m1 tbilrate unemp pop infl realint * * Do the required transformations. The inflation rate is computed as 400*the log * difference. Multiplying by 400 produces annualized percentages. * * The trend would usually be created as set trend = t. However, the regression * output in the book was produced using a trend which is 0 at 1950:1, so we make * the same adjustment to get that to match. The choice of base period for the * trend affects nothing but the coefficient on the intercept. * set logi = log(realinvs) set logy = log(realgdp) set infl = 400.0*log(cpi_u/cpi_u{1}) set trend = t-1 * linreg logi # constant tbilrate infl logy trend * * Test restriction that the 2nd and 3rd coefficients sum to 0 The "1" on the * restrict instruction is for one restriction * restrict(title="Only Real Interest Rate Matters") 1 # 2 3 # 1 1 0.0 * * Same restriction, this time imposing it on the regression (by using the CREATE option) * restrict(create) 1 # 2 3 # 1 1 0.0 * * Reparameterized regression, using the real interest rate and inflation rate in * place of nominal interest rate and inflation rate. The t-stat on the inflation * rate is the test statistic. * set realrate = tbilrate-infl * linreg logi # constant realrate infl logy trend exclude(title="Only Real Rate Matters - Reparameterized Regression") # infl * * Joint restriction * Because the last regression was reparameterized, the joint restriction can be * done using the simpler instruction TEST, which does a joint test of * restrictions to a set of constant values. The first supplementary card lists * the coefficients being restricted; the second lists the values that they take * under the null. * test(title="Joint Restriction - Reparameterized Model") # 3 4 5 # 0.0 1.0 0.0 * * Joint restriction using the original model * linreg logi # constant tbilrate infl logy trend restrict(title="Joint Restriction") 3 # 2 3 # 1 1 0.0 # 4 # 1 1.0 # 5 # 1 0.0