------------------------------------------------------------------------------------------------------------------ log: d:\teaching\計量經濟學\fall2001\ps6q2.log log type: text opened on: 2 Jan 2002, 13:48:36 . clear . infile y x using ps6q2.dat (18 observations read) . reg y x Source | SS df MS Number of obs = 18 -------------+------------------------------ F( 1, 16) = 14.67 Model | 111675595 1 111675595 Prob > F = 0.0015 Residual | 121806451 16 7612903.17 R-squared = 0.4783 -------------+------------------------------ Adj R-squared = 0.4457 Total | 233482046 17 13734238.0 Root MSE = 2759.1 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x | .0319 .0083289 3.83 0.001 .0142435 .0495564 _cons | 193.0593 990.9703 0.19 0.848 -1907.704 2293.822 ------------------------------------------------------------------------------ . predict u,res . g n=_N . g uu=u*u . egen long sumuu=sum(uu) . g hatu2=sumuu/n . g p=uu/hatu2 . reg p x Source | SS df MS Number of obs = 18 -------------+------------------------------ F( 1, 16) = 4.56 Model | 17.8198971 1 17.8198971 Prob > F = 0.0484 Residual | 62.4663266 16 3.90414541 R-squared = 0.2220 -------------+------------------------------ Adj R-squared = 0.1733 Total | 80.2862237 17 4.72271904 Root MSE = 1.9759 ------------------------------------------------------------------------------ p | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x | .0000127 5.96e-06 2.14 0.048 9.86e-08 .0000254 _cons | -.1439725 .7096569 -0.20 0.842 -1.648378 1.360433 ------------------------------------------------------------------------------ . . g x2=x*x . reg uu x x2 Source | SS df MS Number of obs = 18 -------------+------------------------------ F( 2, 15) = 3.06 Model | 1.0646e+15 2 5.3231e+14 Prob > F = 0.0770 Residual | 2.6119e+15 15 1.7413e+14 R-squared = 0.2896 -------------+------------------------------ Adj R-squared = 0.1948 Total | 3.6765e+15 17 2.1627e+14 Root MSE = 1.3e+07 ------------------------------------------------------------------------------ uu | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x | 229.3301 126.2132 1.82 0.089 -39.68693 498.3471 x2 | -.000537 .0004495 -1.19 0.251 -.001495 .000421 _cons | -6218485 6459454 -0.96 0.351 -2.00e+07 7549516 ------------------------------------------------------------------------------ . . reg y x,robust Regression with robust standard errors Number of obs = 18 F( 1, 16) = 9.88 Prob > F = 0.0063 R-squared = 0.4783 Root MSE = 2759.1 ------------------------------------------------------------------------------ | Robust y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x | .0319 .0101468 3.14 0.006 .0103897 .0534102 _cons | 193.0593 533.9063 0.36 0.722 -938.7716 1324.89 ------------------------------------------------------------------------------ . log close log: d:\teaching\計量經濟學\fall2001\ps6q2.log log type: text closed on: 2 Jan 2002, 13:48:36 ------------------------------------------------------------------------------------------------------------------