* PS10.7, using DATA10-4, for Section 10.9 on the error-correction model * TIME 1940 1 SAMPLE 1940.0 1987.0 READ(data10-4) YEAR UG UM GNPDEF HDEM SDEM PRES ELECT REAGAN OPP WW2 KWAR & VWAR KRUS GORB SALT * * Convert the Military, UM, and Total Expenditures, UG, from current dollar * to real terms using the GENR command. * GENR REALMIL=(UM*100)/GNPDEF GENR REALG=(UG*100)/GNPDEF * * The LAG function on the GENR command is used to create the variables * REALMIL(t-1) and REALG(t-1). Note: (t-1) is a subscript. * GENR LREALMIL=LAG(REALMIL) GENR LREALG=LAG(REALG) * * The LOG function on the GENR commands takes the logs of the variables * specified in the parentheses. * GENR MILIT=LOG(REALMIL)-LOG(LREALMIL) GENR GOVT=LOG(REALG)-LOG(LREALG) GENR LONGDEF=LOG(LREALG)-LOG(LREALMIL) * * Before the Basic Error Correction Model can be estimated, the sample * period is changed to begin at 1941 instead of 1940 since one observation * was lost when the variable REALG and REALMIL were lagged back one time * period. The LOGLOG option is specified on the OLS command since the * dependent variable, MILIT and independent variables, GOVT and LONGDEF, * are in log form. Otherwise, the elasticities in the regression output * will be invalid. * SAMPLE 1941.0 1987.0 OLS MILIT GOVT LONGDEF / LOGLOG * * The interaction variables are created as follows with the GENR command. * GENR LPRES=LONGDEF*PRES GENR LELECT=LONGDEF*ELECT GENR LREAGAN=LONGDEF*REAGAN GENR LOPP=LONGDEF*OPP GENR LHDEM=LONGDEF*HDEM GENR LSDEM=LONGDEF*SDEM GENR LWW2=LONGDEF*WW2 GENR LKWAR=LONGDEF*KWAR GENR LVWAR=LONGDEF*VWAR GENR LKRUS=LONGDEF*KRUS GENR LGORB=LONGDEF*GORB GENR LSALT=LONGDEF*SALT * * Estimate Equation 10.27 on page 561 of the textbook. The estimated * regression residuals are saved with the RESID= option on the OLS command * into a vector called UT. * OLS MILIT GOVT LONGDEF LPRES LELECT LREAGAN LOPP LHDEM LSDEM LWW2 LKWAR & LVWAR LKRUS LGORB LSALT / RESID=UT GENR UT1=LAG(UT) * SAMPLE 1942.0 1987.0 OLS UT GOVT LONGDEF LPRES LELECT LREAGAN LOPP LHDEM LSDEM LWW2 LKWAR LVWAR & LKRUS LGORB LSALT UT1 GEN1 LM=$N*$R2 DISTRIB LM / TYPE=CHI DF=1 * * The results in the textbook could not be replicated below since the mixed * Hildreth-Lu and Cochrane-Orcutt cannot be implemented in SHAZAM. Thus the * Cochrane-Orcutt procedure was used instead and the SHAZAM results are * only slight different from those in the textbook. * SAMPLE 1941.0 1987.0 * AUTO MILIT GOVT LONGDEF LPRES LELECT LREAGAN LOPP LHDEM LSDEM LWW2 LKWAR & LVWAR LKRUS LGORB LSALT / DROP GS * omit LHDEM AUTO MILIT GOVT LONGDEF LPRES LELECT LREAGAN LOPP LSDEM LWW2 LKWAR & LVWAR LKRUS LGORB LSALT / DROP GS * omit LELECT AUTO MILIT GOVT LONGDEF LPRES LREAGAN LOPP LSDEM LWW2 LKWAR & LVWAR LKRUS LGORB LSALT / DROP GS * omit LSALT AUTO MILIT GOVT LONGDEF LPRES LREAGAN LOPP LSDEM LWW2 LKWAR & LVWAR LKRUS LGORB / DROP GS * omit LREAGAN AUTO MILIT GOVT LONGDEF LPRES LOPP LSDEM LWW2 LKWAR & LVWAR LKRUS LGORB / DROP GS * omit LGORB AUTO MILIT GOVT LONGDEF LPRES LOPP LSDEM LWW2 LKWAR & LVWAR LKRUS / DROP GS * omit LPRES AUTO MILIT GOVT LONGDEF LOPP LSDEM LWW2 LKWAR & LVWAR LKRUS / DROP GS * omit LOPP AUTO MILIT GOVT LONGDEF LSDEM LWW2 LKWAR LVWAR LKRUS / DROP GS * DELETE / ALL STOP