***************************************************************************** * CHAPTER 12 - STATISTICS FOR BUSINESS & ECONOMICS, 5th Edition * ***************************************************************************** * Example 12.1, p. 489 * * Read this example carefully. Be sure you understand the methodology. * *---------------------------------------------------------------------------- * Example 12.2, p. 492 * * Read this example carefully. Be sure you understand the methodology. * *---------------------------------------------------------------------------- * Example 12.3, p. 494 * * Read this example carefully. Be sure you understand the methodology. * *---------------------------------------------------------------------------- * Example 12.4, p. 498 * * The SAMPLE command is used to specify the sample range of the data to be * read. The READ command inputs the data and assigns variable names. In * this case, the variables are YEAR, Local Advertising per Household in year, * Y, and Retail Sales per Household in year, X. * SAMPLE 1 22 READ(ADRETAIL.DIF) / DIF LIST * * The assumption that advertisers may be unwilling or unable to adjust their * plans to sudent changes in the level of retail sales, the value of local * advertising expenditures per household in the previous year is added to the * model. Thus, the GENR command with the LAG(x) function is used to lag the * Local Advertising per Household expenditures, Y, back one year. * GENR LAGY=LAG(Y) PRINT YEAR Y X LAGY * * The sample range of the data set must be changed to 2 to 22 since one * observation is lost when the variable Y is lagged back one year. If the * sample range is not changed to reflect the lagged variable, the regression * estimates would be incorrect. * * The COEF= option is used on the OLS command to save the regression estimates * in the vector called COEF. These coefficients will be used in calculating * the expected impact on Local Advertising per Household with the GEN1 * command. The estimated coefficient for RSALES is stored in Row 1 of the * vector COEF (COEF:1), LAGADVT is stored in Row 2 (COEF:2) and the regression * constant is stored in Row 3 (COEF:3). * * The TEST command tests the Null Hypothesis that the coefficient on the * lagged Local Advertising per Household, LAGADVT, is equal to 0. * SAMPLE 2 22 OLS Y X LAGY / ANOVA COEF=COEF TEST LAGY=0 * * The expected impact on local advertising per household due to a retail * sales per household increase is calculated with the GEN1 command. The * total total effect on all future advertising expenditure per household, * is defined as TOTAL with the GEN1 command. * GEN1 INCR1=COEF:2*COEF:1 GEN1 INCR2=(COEF:2**2)*COEF:1 GEN1 TOTAL=COEF:1/(1-COEF:2) PRINT INCR1 INCR2 TOTAL * DELETE / ALL *---------------------------------------------------------------------------- * Example 12.5, p. 504 * * The annual data on the Percentage of Profit Margin of Savings and Loans * Association, Y, and their Percentage of Net Revenues per Deposit Dollar, * X1, and the Number of Offices, X2 is defined. * SAMPLE 1 25 READ(SAVLOAN.DIF) / DIF LIST * * Estimate the regression of Profit Margin, Y on Net Revenue per Deposit * Dollar, X1 and the Number of Offices, X2. * OLS Y X1 X2 * * Estimate the regression of Profit Margin, Y on Net Revenue per Deposit * Dollar, X1. * OLS Y X1 * *---------------------------------------------------------------------------- * Heteroskedascity, p. 508 * * The LIST option on the OLS command lists and plots the residuals and * predicted values of the dependent variable and residual statistics. The * predicted values of the dependent variable, Y are saved with the PREDICT= * option and the regression residuals are saved with the RESID= option on * the OLS command. * OLS Y X1 X2 / LIST PREDICT=YHAT RESID=E * * The PLOT command is used to plot the regression residuals against the * Revenues per Deposit Dollar, X1. * * Figure 12.11, p. 509 * PLOT E X1 * * Next, the regression residuals are plotted against the Number of Offices, * X2. * * Figure 12.12, p. 510 * PLOT E X2 * * Finally, the regression residuals are plotted against the predicted Profit * Margin. * * Figure 12.13, p. 510 * PLOT E YHAT * * The GENR command is used to calculate the squared residuals, E2. * GENR E2=E**2 * * The OLS command is used to estimate the least squares regression of squared * residuals, E2 on the predicted values, YHAT. The GEN1 command specified * after the OLS command computes the test statistic defined as STAT. The * temporary variables $N is defined as the number of observations and $R2 * is defined as the R-square from the preceeding OLS regression. * OLS E2 YHAT TEST YHAT=0 GEN1 STAT=$N*$R2 PRINT STAT * * The GEN1 and DISTRIB command is used to print out critical values in lieu * of referring to a statistical table. The GEN1 command is used to generate * a constant, X, at the 1% level of significance before the DISTRIB command * can be executed. The format of the DISTRIB command is: * * DISTRIB vars / options * * where: vars = list of variables * options = list of desired options * TYPE= - specifies the type of distribution * DF= - specifies the degrees of freedom * INVERSE = computes the inverse survival function * GEN1 X=0.10 DISTRIB X / TYPE=CHI DF=1 INVERSE * *---------------------------------------------------------------------------- * Autocorrelated Errors - Figure 12.18, p. 517 * * The Durbin-Watson statistic is available in the temporary variable $DW * after an OLS regression if the RSTAT, LIST or MAX options are specified. * The PRINT command is used to print the Durbin-Watson statistic. * OLS Y X1 X2 / RSTAT PRINT $DW * DELETE / ALL *---------------------------------------------------------------------------- * Example 12.6, p. 519 * * The TIME command specifies the beginning year and frequency for the time * series data found in the MACRO2000.DIF file. An alternate form of the * SAMPLE command will be used with the TIME command. The format of the * TIME command is: * * TIME beg freq var * * where: beg = beginning year * freq = frequency of the data (1=annual data, 4=quarterly * data, 12=monthly data) * var = optional variable name to store dates * * The data below first sets the TIME to the beginning year of 1946 and the * frequency of the data to quarterly. The SAMPLE command sets the data range * from First Quarter 1946 to Second Quarter 2000. * TIME 1946 4 SAMPLE 1946.1 2000.2 READ(MACRO2000.DIF) / DIF * * The SAMPLE command below takes the subset of data from Fourth Quarter 1979 * to Second Quarter 2000 for the OLS estimation procedure corresponding to * the output in Figure 12.20, p. 520. * SAMPLE 1979.4 2000.2 OLS CDH YPDH FFED / ANOVA RSTAT * * The GEN1 command is used to estimate the serial correlation value, R, * after the OLS regression as the Durbin-Watson statistic from the previous * regression is required. * GEN1 R=1-($DW/2) PRINT $DW R * * Figure 12.22, p. 521 * * The GENR command is used to transform the variables using the Serial * Correlation, R estimate before the regression results can be estimated. * GENR CDHADJ=CDH-R*LAG(CDH) GENR YPDHADJ=YPDH-R*LAG(YPDH) GENR FFEDADJ=FFED-R*LAG(FFED) * * The SAMPLE range is change to the First Quarter of 1980 since all variables * in the regression model are lagged back one time period. * SAMPLE 1980.1 2000.2 OLS CDHADJ YPDHADJ FFEDADJ / RSTAT TEST YPDHADJ=0 TEST FFEDADJ=0 PRINT $DW * DELETE / ALL *---------------------------------------------------------------------------- * STOP