REGWHITETEST Procedure |
@REGWHITETEST is a regression post-processing procedure for doing a "White" test for heteroscedasticity. This needs to be preceded by a LINREG instruction.
@RegWhiteTest( options ) (no parameters)
Options
TYPE=[FULL]/NOCROSSTERMS/FITTEDONLY/BP
TYPE=FULL does the full set of interaction terms
TYPE=NOCROSSTERMS includes the regressors and their squares, but no interaction variables
TYPE=FITTEDONLY includes only 1, the fitted value and its square
TYPE=BP does just the regressors (no squares). This is the standard Breusch-Pagan test.
ROBUST/[NOROBUST]
If ROBUST, does an LM test robust to heteroscedasticity in the Xuu'X terms
Example
This does two variations on the test, one with all the interaction terms, the other with just the regressors and their squares without the cross terms. It first does these using auxiliary regressions, then with the procedures. The auxiliary regressions are only for illustration—in fact, because @REGWHITETEST applies to the most recent regression, you don't want them, which is why we redo the LINREG of interest.
*
* Gujarati, Basic Econometrics, 4th edition
* Example 11.9, page 422.
*
open data table6-4.prn
data(format=prn,org=columns) 1 64
*
linreg cm / resids
# constant pgnp flr
*
* White test - done using auxiliary regressions
*
set gnpsq = pgnp^2
set flrsq = flr^2
set gnpflr = pgnp*flr
linreg usq
# constant pgnp flr gnpsq flrsq
cdf(title="White Test Omitting Cross Term") chisqr %trsquared 4
linreg usq
# constant pgnp flr gnpsq flrsq gnpflr
cdf(title="White Test Including Cross Term") chisqr %trsquared 5
*
* White test - done using the RegWhiteTest procedure. You apply this
* immediately after the regression that you want to test. Use the
* TYPE=NOCROSS option to get the test without the cross terms.
*
linreg cm
# constant pgnp flr
@RegWhiteTest
@RegWhiteTest(type=nocross)
Sample Output
These are the two tests. The full White test has five degrees of freedom (each (non-CONSTANT) regressor, each regressor squared, and the product of the two), while the NOCROSS test has four. If you have terms that get duplicated, the degrees of freedom will be corrected for that.
White Heteroscedasticity Test
Chi-Squared(5)= 2.356718 with Significance Level 0.79790172
White Heteroscedasticity Test without Cross Terms
Chi-Squared(4)= 2.356097 with Significance Level 0.67057540
Copyright © 2025 Thomas A. Doan