Cook-Weisberg test for heteroskedasticity (STB-10: srd14) ----------------------------------------- ^cwhetero^ varlist Description ----------- ^cwhetero^ is a test for heteroskedasticity (nonconstant variance) in a regres- sion that is a function of one or more of the variables in the regression. The varlist is a subset of the right-hand-side variables from the original regression (the "subset" may include all the original variables). This command can only be used after ^fit^. No options other than the variables you think may be related to a possible nonconstant variance are allowed. Your data set will automatically be reset to the data set on disk. Thus, if you want to test more than one set of variables you must re-estimate your original regression (see below). Remember that if you want to re-estimate your model without seeing the output, use "quietly fit ...". In this way, you can perform several heteroskedasticity tests and have the results all on the screen at once. A test, with p-value, of the hypothesis is presented (if test is statistically significant, there is a problem) and a graph is also presented (if the graph shows a "wedge" shape there is a problem). A second test is always presented: whether the form of the heteroskesticity is a function of the predicted values, one of the common expectations. The following example uses the weisgas.dta data file (S. Weisberg, Applied Linear Regression, 2d ed., NY: Wiley, 137-140 (discussion starts on p. 135). The graph is NOT saved. Example ------- . us weisgas . fit y x1-x4 Source | SS df MS Number of obs = 32 ---------+------------------------------ F( 4, 27) = 84.54 Model | 2520.27241 4 630.068101 Prob > F = 0.0000 Residual | 201.227595 27 7.45287388 R-square = 0.9261 ---------+------------------------------ Adj R-square = 0.9151 Total | 2721.50 31 87.7903226 Root MSE = 2.73 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------+-------------------------------------------------------------------- x1 | -.0286089 .0906015 -0.316 0.755 -.2145079 .1572901 x2 | .2158169 .067718 3.187 0.004 .076871 .3547628 x3 | -4.320052 2.850967 -1.515 0.141 -10.16975 1.52965 x4 | 8.97489 2.772632 3.237 0.003 3.28592 14.66386 _cons | 1.015018 1.861308 0.545 0.590 -2.804072 4.834107 ------------------------------------------------------------------------------ . cwhetero x1 Score test (x1) = 1.395; chi-square p-value (df) = 0.238 (1) Score test (pred fit) = 0.000; chi-square p-value (df) = 0.985 (1) . qui fit y x1-x4 . cwhetero x4 Score test (x4) = 0.010; chi-square p-value (df) = 0.922 (1) Score test (pred fit) = 0.000; chi-square p-value (df) = 0.985 (1) . qui fit y x1-x4 . cwhetero x1 x4 Score test (x1 x4) = 9.283; chi-square p-value (df) = 0.010 (2) Score test (pred fit) = 0.000; chi-square p-value (df) = 0.985 (1) . qui fit y x1-x4 . cwhetero x1-x4 Score test (x1 x2 x3 x4) = 10.299; chi-square p-value (df) = 0.036 (4) Score test (pred fit) = 0.000; chi-square p-value (df) = 0.985 (1) Author ------ Richard Goldstein, Qualitas, Brighton, MA EMAIL goldst@@harvarda.bitnet