* PS10.6, using DATA10-3, for Example 10.5 * TIME 1973 12 SAMPLE 1973.01 1986.01 READ(data10-3) PERIOD XRATE * GENR T=TIME(0) * * Generate a new variable called XRATE1 which is equivalent to the variable * XRATE lagged back one time period. * GENR XRATE1=LAG(XRATE) * * The SAMPLE period is changed from 1973.01 to 1973.02 since one observation * was lost when the variable XRATE1 was generated. * * A change measures the difference between what the value of a good is today * relative to the value of the good yesterday. Therefore, to determine the * change in the exchange rate one must measure the difference in the exchange * rate today relative to the exchange rate yesterday. In this example, the * change in the exchange rate variable, CHXRATE, is created when the exchange * rate variable, XRATE, is subtracted from the exchange rate lagged back * one period variable, XRATE1. * * The GENR command is used to generate the new variable, CHXRATE1, that * measures the difference in the exchange rate, XRATE, this period and the * exchange rate, XRATE1, lagged back one time period. * SAMPLE 1973.02 1986.01 GENR CHXRATE=XRATE-XRATE1 GENR CHXRATE1=LAG(CHXRATE) * * Before the Unrestricted Model can be estimated. The sample period must * be changed from 1973.02 to 1973.03 since one observation was lost when * the variable CHXRATE was lagged back one period. * SAMPLE 1973.03 1986.01 OLS CHXRATE T XRATE1 CHXRATE1 * * The GEN1 command is used to store the Sum of Squared Errors from the * Unrestricted Model in the constant called ESSU, Number of Observations * in the constant T, and the Number of Parameters/Coefficients in the * constant K. * GEN1 ESSU=$SSE GEN1 DFU=$DF * * Estimate the Restricted Model and save the Sum of Squared Erros in the * constant called ESSR using the GEN1 command. * OLS CHXRATE CHXRATE1 GEN1 ESSR=$SSE * * Calculate and print the Wald F-statistic using the GEN1 and PRINT commands. * GEN1 F=((ESSR-ESSU)/2)/(ESSU/DFU) DISTRIB F / TYPE=F DF1=2 DF2=DFU * DELETE / ALL STOP