* * Application: estimation d'une equation d'investissement (voir Greene) / TD1 Econométrie / M1 EFI 2011-2012 cal 1968 * open data bdd1.txt data(format=prn,org=columns,verbose) 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 set constant = 1 graph 2 # rinv # rgnp stat(print) rinv stat(print) rgnp print(picture="*.###") / rinv constant trend rgnp interest * * 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 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) # 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 "Byx =" %cmom(1,2)/%cmom(1,1)