HTML Code:
clear all input y x1 x2 x3 99.2 96.7 101 12 99 98.1 100.1 15 100 100 100 17 111.6 104.9 90.6 22 122.2 104.9 86.5 36 117.6 109.5 89.7 45 121.1 110.8 90.6 66 136 112.3 82.8 89 154.2 109.3 70.1 99 153.6 105.3 65.4 118 158.5 101.7 61.3 134 140.6 95.4 62.5 151 136.2 96.4 63.6 167 168 97.6 52.6 184 154.3 102.4 59.7 200 149 101.6 59.5 217 165.5 103.8 61.3 233 end reg y x1 x2 x3 estat ovtest reg y x1 x2 x3 predict double yh gen yh2 = yh^2 gen yh3 = yh^3 gen yh4 = yh^4 reg y x1 x2 x3 yh2 yh3 yh4, noomitted test yh2 yh3 yh4
HTML Code:
. reg y x1 x2 x3 Source | SS df MS Number of obs = 17 -------------+------------------------------ F( 3, 13) = 84.64 Model | 8461.08634 3 2820.36211 Prob > F = 0.0000 Residual | 433.163821 13 33.3202939 R-squared = 0.9513 -------------+------------------------------ Adj R-squared = 0.9401 Total | 8894.25016 16 555.890635 Root MSE = 5.7724 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x1 | 1.060841 .2769969 3.83 0.002 .4624256 1.659257 x2 | -1.397391 .2321721 -6.02 0.000 -1.898969 -.895814 x3 | -.0034456 .0514889 -0.07 0.948 -.1146807 .1077894 _cons | 132.2612 36.46863 3.63 0.003 53.47554 211.0469 ------------------------------------------------------------------------------ . estat ovtest Ramsey RESET test using powers of the fitted values of y Ho: model has no omitted variables F(3, 10) = 3.94 Prob > F = 0.0429
HTML Code:
. reg y x1 x2 x3
Source | SS df MS Number of obs = 17
-------------+------------------------------ F( 3, 13) = 84.64
Model | 8461.08634 3 2820.36211 Prob > F = 0.0000
Residual | 433.163821 13 33.3202939 R-squared = 0.9513
-------------+------------------------------ Adj R-squared = 0.9401
Total | 8894.25016 16 555.890635 Root MSE = 5.7724
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x1 | 1.060841 .2769969 3.83 0.002 .4624256 1.659257
x2 | -1.397391 .2321721 -6.02 0.000 -1.898969 -.895814
x3 | -.0034456 .0514889 -0.07 0.948 -.1146807 .1077894
_cons | 132.2612 36.46863 3.63 0.003 53.47554 211.0469
------------------------------------------------------------------------------
. predict double yh
(option xb assumed; fitted values)
. gen yh2 = yh^2
. gen yh3 = yh^3
. gen yh4 = yh^4
. reg y x1 x2 x3 yh2 yh3 yh4, noomitted
Source | SS df MS Number of obs = 17
-------------+------------------------------ F( 6, 10) = 73.05
Model | 8695.85007 6 1449.30835 Prob > F = 0.0000
Residual | 198.400089 10 19.8400089 R-squared = 0.9777
-------------+------------------------------ Adj R-squared = 0.9643
Total | 8894.25016 16 555.890635 Root MSE = 4.4542
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x1 | -72.75485 106.4014 -0.68 0.510 -309.832 164.3223
x2 | 96.4665 140.1559 0.69 0.507 -215.8203 408.7533
x3 | .2020127 .347275 0.58 0.574 -.5717642 .9757895
yh2 | .795382 1.182519 0.67 0.516 -1.839436 3.4302
yh3 | -.0040173 .0061253 -0.66 0.527 -.0176653 .0096306
yh4 | 7.64e-06 .0000118 0.65 0.531 -.0000186 .0000339
_cons | -6875.445 10117.14 -0.68 0.512 -29417.84 15666.95
------------------------------------------------------------------------------
. test yh2 yh3 yh4
( 1) yh2 = 0
( 2) yh3 = 0
( 3) yh4 = 0
F( 3, 10) = 3.94
Prob > F = 0.0429

Comment