* Reference: Chapter 2 of * Ernst R. Berndt, The Practice of Econometrics, Addison-Wesley, 1991. SAMPLE 1 120 * Generate a date variable TIME 1978 12 DATEM READ (MOBIL) RETURN / SKIPLINE=1 CLOSE READ (RKFREE) RFREE / SKIPLINE=1 CLOSE READ (MARKET) RM / SKIPLINE=1 CLOSE * Exercise 1, p. 43 * (a) Plot the market return for ALL observations in the sample. GRAPH RM / TIME LINEONLY * (b) risk premium measure for MOBIL GENR CRISK=RETURN-RFREE * (c) Plots for the entire sample. GRAPH CRISK / TIME LINEONLY * market risk premium GENR DIFF=RM-RFREE GRAPH DIFF / TIME LINEONLY * (d) Summary statistics - last 36 observations SAMPLE 85 120 STAT CRISK DIFF / PCOR VAR=VAR COV=COV * Calculate the implied beta GEN1 beta=COV:2/VAR:2 PRINT beta * Use OLS to get the same result OLS CRISK DIFF * Exercise 2, p. 44 * (a) & (b) First 60 observations for MOBIL SAMPLE 1 60 OLS CRISK DIFF / GRAPH ANOVA * (c) Hypothesis test TEST CONSTANT=0 * 95% confidence interval CONFID CONSTANT * (d) Another hypothesis test - the variable name DIFF represents * the coefficient beta. CONFID DIFF TEST DIFF=1 * (e) Calculate the systematic risk - see page 40. * The r-square from the OLS regression measures the systematic * portion of total risk. The SHAZAM temporary variable $R2 * saves the R-square value from the previous OLS regression. GEN1 rsquare=$R2 PRINT rsquare * Exercise 3 - p. 45 SAMPLE 1 120 * Note that the sample period for this exercise is different from * the previous exercises READ (GOLD) DATE GOLD MARK76 RKFR76 / SKIPLINE=1 CLOSE * (a) Gold-specific and market risk premiums GENR RG=GOLD-RKFR76 GENR RA=MARK76-RKFR76 * Restrict to a 4-year time period. SAMPLE 1 48 * Estimate the beta OLS RG RA * 95% confidence interval for beta CONFID RA * (b) Another sample period SAMPLE 49 120 OLS RG RA CONFID RA * Exercise 4, p. 45. SAMPLE 1 120 READ (DELTA) RETD / SKIPLINE=1 CLOSE GENR DRISK=RETD-RFREE * (a) & (b) Set the sample period SAMPLE 85 120 * Run a reverse regression and save the coefficient estimates in BX. OLS DIFF DRISK / COEF=BX TEST DRISK=0 * Calculate an implicit estimate of beta - this is based in * the incorrect regression. TEST 1/DRISK * Get an estimate of alpha TEST -CONSTANT/DRISK STAT DIFF DRISK / VAR=VAR * Now obtain the CAPM estimate for beta GEN1 betahat=(BX:1)*(VAR:2)/(VAR:1) PRINT betahat * (c) Run the CAPM regression. OLS DRISK DIFF * Test the null hypothesis that beta=0 TEST DIFF=0 * Exercise 6, p. 48. * (a) Analyze MOBIL - estimate a beta for two samples SAMPLE 1 60 OLS CRISK DIFF SAMPLE 61 120 OLS CRISK DIFF * Calculate the CHOW test SAMPLE 1 120 OLS CRISK DIFF * The DIAGNOS command is used for calculating test statistics * following an OLS command. * The CHOWONE= option specifies the number of observations * in the first group for a CHOW test statistic. DIAGNOS / CHOWONE=60 * For a significance level of 5%, if the p-value for the Chow test * statistic is less than 0.05 then reject the null hypothesis of * identical coefficients over time. * An assumption of the Chow test is identical error variance in the * two groups. A test for different error variances is reported * with the Goldfeld-Quandt test statistic. * Exercise 8, p. 50 * (c) Generate monthly seasonal dummy variables MATRIX MDUM=SEAS(120,12) * Form the January dummy variable GENR DUMJ=MDUM:1 * Check that the dummy variable is constructed correctly. PRINT DATEM DUMJ * Use the returns for MOBIL OLS RETURN DUMJ * (d) Chow test that parameters of the CAPM in January are equal to * those of the remaining months of the year. * Use a dummy variable regression. * Generate a slope dummy variable. GENR XDUMJ=DIFF*DUMJ OLS CRISK DUMJ DIFF XDUMJ * Obtain a F-test statistic. TEST TEST DUMJ=0 TEST XDUMJ=0 END * (e) Another test of the "January is different" hypothesis. OLS CRISK DUMJ DIFF * Exercise 10, p. 53 - Diagnostic testing for MOBIL SAMPLE 1 120 * The DWPVALUE option on the OLS command reports the Durbin-Watson * test statistic and p-value. * The GF option reports the Jarque-Bera test statistic for * normality of the residuals. OLS CRISK DIFF / RESID=E GF DWPVALUE RSTAT * The HET option on the DIAGNOS command calculates a variety of * test statistics for heteroskedasticity following an OLS regression. DIAGNOS / HET * A test statistic based on an auxiliary regression with the * squared residuals as the dependent variable and DIFF and DIFF**2 * as the regressors is reported on the SHAZAM output as the White test: * E**2 ON X X**2 (WHITE) TEST: D.F. P-VALUE * KOENKER(R2): 6.934 2 0.03121 * The reported p-value of 0.03 suggests to reject homoskedastic * residuals at a 5% significance level, but do not reject at a * 1% level. It should be noted that the test is valid for "large" * samples. STOP