Ramsey Specification Error Tests -------------------------------- AUTHOR: Richard Goldstein, Qualitas SUPPORT: Written communication only, EMAIL goldst@@harvarda.bitnet or 37 Kirkwood Road, Brighton MA 02135. ^ramsey^ varlist [^in^ range] [^if^ exp] ^ramsey^ includes two tests for specification error: the first is a test of ^heteroscestacity^; the second a test for possible ^omitted variables^. There are two versions of this last test. In all cases, your real interest should be in the results of a joint test of significance of the added variables that appears after the regression. If significant, you have a problem! The second version of the omitted variables test is more powerful than the first version unless you have dummy variables in the regression--in that case it will not be meaningful--this will announce itself since a number of variables will be dropped by Stata in the regression. Thursby, JG and P Schmidt (1977), "Some Properties of Tests for Specification Error in a Linear Regression Model", ^JASA^, 72, pp. 635-41. ^ramsey^ limits these powers to non-dummy variables, which it identifies by the storage type of the variable. Variables stored as ^byte^s are assumed to be dum- mies, the rest nondummies. Thus, be sure that nondummy variables are not stored as ^byte^ if you want to use their powers in the test; on the other hand, ensure that dummy variables do have a type of ^byte^. The first regression output is the standard regression being tested. Example: -------- . ^use auto^ (1978 Automobile Data) . ^ramsey mpg weight weightsq^ (obs=74) Source | SS df MS Number of obs = 74 ---------+------------------------------ F( 2, 71) = 72.80 Model | 1642.52197 2 821.260986 Prob > F = 0.0000 Residual | 800.937487 71 11.2808097 R-square = 0.6722 ---------+------------------------------ Adj R-square = 0.6630 Total | 2443.45946 73 33.4720474 Root MSE = 3.3587 Variable | Coefficient Std. Error t Prob > |t| Mean ---------+-------------------------------------------------------------- mpg | 21.2973 ---------+-------------------------------------------------------------- weight | -.0141581 .0038835 -3.646 0.001 3019.459 weightsq | 1.32e-06 6.26e-07 2.116 0.038 9713003 _cons | 51.18308 5.767884 8.874 0.000 1 ---------+-------------------------------------------------------------- Two versions of Ramsey's RESET test: First, as a test of heteroscedasticity: (obs=74) Source | SS df MS Number of obs = 74 ---------+------------------------------ F( 3, 70) = 0.04 Model | 1.21940831 3 .406469437 Prob > F = 0.9909 Residual | 799.718079 70 11.424544 R-square = 0.0015 ---------+------------------------------ Adj R-square = -0.0413 Total | 800.937487 73 10.9717464 Root MSE = 3.38 Variable | Coefficient Std. Error t Prob > |t| Mean ---------+-------------------------------------------------------------- _res | -2.67e-12 ---------+-------------------------------------------------------------- yh2 | -.0114603 .1564627 -0.073 0.942 475.7711 yh3 | .000471 .0093994 0.050 0.960 11113.51 yh4 | -4.33e-06 .0001557 -0.028 0.978 270062.9 _cons | 1.388612 12.04563 0.115 0.909 1 ---------+-------------------------------------------------------------- ( 1) yh2 = 0.0 ( 2) yh3 = 0.0 ( 3) yh4 = 0.0 F( 3, 70) = 0.04 Prob > F = 0.9909 Second, as a test of whether there are any omitted variables, or the functional form is misspecified: (obs=74) Source | SS df MS Number of obs = 74 ---------+------------------------------ F( 5, 68) = 29.06 Model | 1664.52339 5 332.904678 Prob > F = 0.0000 Residual | 778.936068 68 11.4549422 R-square = 0.6812 ---------+------------------------------ Adj R-square = 0.6578 Total | 2443.45946 73 33.4720474 Root MSE = 3.3845 Variable | Coefficient Std. Error t Prob > |t| Mean ---------+-------------------------------------------------------------- mpg | 21.2973 ---------+-------------------------------------------------------------- weight | -1.147618 1.435281 -0.800 0.427 3019.459 weightsq | .000108 .0001365 0.791 0.431 9713003 yh2 | -5.385193 6.275968 -0.858 0.394 475.7711 yh3 | .1599918 .1762284 0.908 0.367 11113.51 yh4 | -.0017591 .0018613 -0.945 0.348 270062.9 _cons | 3696.167 4538.87 0.814 0.418 1 ---------+-------------------------------------------------------------- ( 1) yh2 = 0.0 ( 2) yh3 = 0.0 ( 3) yh4 = 0.0 F( 3, 68) = 0.64 Prob > F = 0.5917 (obs=74) Source | SS df MS Number of obs = 74 ---------+------------------------------ F( 6, 67) = 25.06 Model | 1690.25795 6 281.709658 Prob > F = 0.0000 Residual | 753.201509 67 11.2418136 R-square = 0.6917 ---------+------------------------------ Adj R-square = 0.6641 Total | 2443.45946 73 33.4720474 Root MSE = 3.3529 Variable | Coefficient Std. Error t Prob > |t| Mean ---------+-------------------------------------------------------------- mpg | 21.2973 ---------+-------------------------------------------------------------- weight | 3.124201 1.70363 1.834 0.071 3019.459 weightsq | -.0023042 .0012509 -1.842 0.070 9713003 zsq1 | (dropped) zcu1 | 8.06e-07 4.38e-07 1.839 0.070 3.30e+10 zqu1 | -1.21e-10 6.62e-11 -1.832 0.071 1.17e+14 zsq2 | (dropped) zcu2 | 1.56e-18 8.62e-19 1.811 0.075 1.65e+21 zqu2 | -1.50e-26 8.39e-27 -1.788 0.078 2.59e+28 _cons | -1610.871 905.5459 -1.779 0.080 1 ---------+-------------------------------------------------------------- ( 1) zsq1 = 0.0 ( 2) zcu1 = 0.0 ( 3) zqu1 = 0.0 ( 4) zsq2 = 0.0 ( 5) zcu2 = 0.0 ( 6) zqu2 = 0.0 Constraint 1 dropped Constraint 3 dropped Constraint 4 dropped Constraint 5 dropped Constraint 6 dropped F( 1, 67) = 3.38 Prob > F = 0.0703 Results: -------- Note that here, even though there are no dummy variables, the second version of the second test is not meaningful as 5 of the 6 constraints have been dropped! This will tend to happen in quadratic or other polynomial models. In general for polynomial models, the ^pswdiff^ will be more informative than will the Ramsey RESET test.