* * 3.2.2 from pages 21-24 * open data tablef3-1[1].txt calendar 1968 data(format=prn,org=columns) 1968:1 1982:1 year gnp invest cpi interest * * gnp is in billions and the cpi is based on 100. To get real GNP in trillions we * need to divide by cpi, then divide by 1000 (to convert billions to trillions) * and multiply by 100, to correct the cpi base. Combining those means we multiply * by .1. * set rgnp = gnp/cpi*(.1) set rinv = invest/cpi*(.1) set trend = t * * The cross products of the variables can be computed using the instruction * CMOMENT. Here, we list the three explanatory variables first, followed by the * dependent variable. As you read across the first three rows in the printed * matrix, you'll get the sums in the 3x3 system of equations on page 21 * cmom(print) # constant trend rgnp rinv * * You can get the cross product matrix of deviations from the mean, by using the * option "CENTER" on CMOM. The CONSTANT can then be omitted. Note the advice on * the bottom of Table 3.1 - these aren't going to quite match the numbers that go * into the calculation of b2 and b3 because those are based upon rounded numbers. * cmom(center,print) # trend rgnp rinv * * The elements of this matrix can be obtained by %cmom(i,j) where i is the row * and j the column. For instance, the byg at the bottom of page 22 can be computed * by * disp "Byg=" %cmom(2,3)/%cmom(2,2)