--------------------------------------------------------------------------------------- log: D:\teaching\計量經濟學\fall2002\ps6q1.log log type: text opened on: 10 Jan 2003, 12:21:05 . infile y x using ps6q1.dat (9 observations read) . reg y x Source | SS df MS Number of obs = 9 -------------+------------------------------ F( 1, 7) = 6.04 Model | 663404.555 1 663404.555 Prob > F = 0.0437 Residual | 769379.445 7 109911.349 R-squared = 0.4630 -------------+------------------------------ Adj R-squared = 0.3863 Total | 1432784.00 8 179098.00 Root MSE = 331.53 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x | .2411383 .0981518 2.46 0.044 .0090462 .4732304 _cons | 1906.16 920.6569 2.07 0.077 -270.8474 4083.168 ------------------------------------------------------------------------------ . predict u,res . list y x u 1. 3396 9355 -766.0089 2. 3787 8584 -189.0912 3. 4013 7962 186.8968 4. 4014 8275 112.4205 5. 4146 8389 216.9308 6. 4241 9418 63.79947 7. 4387 9795 118.8903 8. 4538 10281 152.6971 9. 4843 11750 103.465 . g lnu2=ln(u*u) . g lnx=ln(x) . reg lnu2 lnx Source | SS df MS Number of obs = 9 -------------+------------------------------ F( 1, 7) = 0.36 Model | .749425218 1 .749425218 Prob > F = 0.5682 Residual | 14.6315877 7 2.09022682 R-squared = 0.0487 -------------+------------------------------ Adj R-squared = -0.0872 Total | 15.381013 8 1.92262662 Root MSE = 1.4458 ------------------------------------------------------------------------------ lnu2 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- lnx | -2.477002 4.136746 -0.60 0.568 -12.25885 7.304848 _cons | 32.80193 37.78034 0.87 0.414 -56.53437 122.1382 ------------------------------------------------------------------------------ . g abu=abs(u) . g sqx=sqrt(x) . reg abu x Source | SS df MS Number of obs = 9 -------------+------------------------------ F( 1, 7) = 0.07 Model | 3852.59193 1 3852.59193 Prob > F = 0.7922 Residual | 360097.531 7 51442.5045 R-squared = 0.0106 -------------+------------------------------ Adj R-squared = -0.1308 Total | 363950.123 8 45493.7654 Root MSE = 226.81 ------------------------------------------------------------------------------ abu | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x | -.0183761 .0671488 -0.27 0.792 -.1771577 .1404055 _cons | 383.3648 629.8506 0.61 0.562 -1105.995 1872.725 ------------------------------------------------------------------------------ . reg abu sqx Source | SS df MS Number of obs = 9 -------------+------------------------------ F( 1, 7) = 0.06 Model | 3213.30227 1 3213.30227 Prob > F = 0.8100 Residual | 360736.821 7 51533.8316 R-squared = 0.0088 -------------+------------------------------ Adj R-squared = -0.1328 Total | 363950.123 8 45493.7654 Root MSE = 227.01 ------------------------------------------------------------------------------ abu | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- sqx | -3.305537 13.2377 -0.25 0.810 -34.60772 27.99664 _cons | 530.6663 1277.428 0.42 0.690 -2489.972 3551.304 ------------------------------------------------------------------------------ . sort abu . g du=_n . sort x . g dx=_n . g d2=(du-dx)^2 . egen d=sum(d2) . g n=_N . g rs=1-(6*d/(n*(n^2-1))) . g t=rs*sqrt(n-2)/sqrt(1-rs^2) . sum rs t Variable | Obs Mean Std. Dev. Min Max -------------+----------------------------------------------------- rs | 9 -.4 0 -.4 -.4 t | 9 -1.154701 0 -1.154701 -1.154701 . log close log: D:\teaching\計量經濟學\fall2002\ps6q1.log log type: text closed on: 10 Jan 2003, 12:21:05 ---------------------------------------------------------------------------------------