-------------------------------------------------------------------------------- log: C:\Documents and Settings\Patricia_Anderson\My Documents\ECON 20\In > Class\oct23.log log type: text opened on: 23 Oct 2002, 11:12:06 . use hprice1 . reg price lotsize sqrft bdrms colonial Source | SS df MS Number of obs = 88 -------------+------------------------------ F( 4, 83) = 43.25 Model | 620278.635 4 155069.659 Prob > F = 0.0000 Residual | 297575.871 83 3585.25145 R-squared = 0.6758 -------------+------------------------------ Adj R-squared = 0.6602 Total | 917854.506 87 10550.0518 Root MSE = 59.877 ------------------------------------------------------------------------------ price | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- lotsize | .0020758 .0006427 3.23 0.002 .0007976 .003354 sqrft | .1242375 .0133383 9.31 0.000 .0977082 .1507667 bdrms | 11.00429 9.51526 1.16 0.251 -7.921178 29.92976 colonial | 13.71554 14.63727 0.94 0.351 -15.39739 42.82847 _cons | -24.12653 29.60345 -0.81 0.417 -83.00661 34.75355 ------------------------------------------------------------------------------ . reg price lotsize sqrft bdrms colonial, robust Regression with robust standard errors Number of obs = 88 F( 4, 83) = 18.24 Prob > F = 0.0000 R-squared = 0.6758 Root MSE = 59.877 ------------------------------------------------------------------------------ | Robust price | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- lotsize | .0020758 .0012923 1.61 0.112 -.0004944 .0046461 sqrft | .1242375 .0178355 6.97 0.000 .0887633 .1597117 bdrms | 11.00429 9.258737 1.19 0.238 -7.410963 29.41955 colonial | 13.71554 16.42975 0.83 0.406 -18.96256 46.39365 _cons | -24.12653 37.7776 -0.64 0.525 -99.26465 51.01159 ------------------------------------------------------------------------------ . reg lprice llotsize lsqrft bdrms colonial Source | SS df MS Number of obs = 88 -------------+------------------------------ F( 4, 83) = 38.38 Model | 5.20397919 4 1.3009948 Prob > F = 0.0000 Residual | 2.81362433 83 .033899088 R-squared = 0.6491 -------------+------------------------------ Adj R-squared = 0.6322 Total | 8.01760352 87 .092156362 Root MSE = .18412 ------------------------------------------------------------------------------ lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- llotsize | .1678189 .0381807 4.40 0.000 .0918791 .2437587 lsqrft | .7071931 .092802 7.62 0.000 .5226138 .8917725 bdrms | .0268305 .0287236 0.93 0.353 -.0302995 .0839605 colonial | .0537962 .0447732 1.20 0.233 -.0352559 .1428483 _cons | -1.349589 .651041 -2.07 0.041 -2.644483 -.0546947 ------------------------------------------------------------------------------ . reg lprice llotsize lsqrft bdrms colonial, robust Regression with robust standard errors Number of obs = 88 F( 4, 83) = 34.50 Prob > F = 0.0000 R-squared = 0.6491 Root MSE = .18412 ------------------------------------------------------------------------------ | Robust lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- llotsize | .1678189 .0440356 3.81 0.000 .0802338 .2554041 lsqrft | .7071931 .1090447 6.49 0.000 .4903076 .9240786 bdrms | .0268305 .032718 0.82 0.415 -.0382444 .0919053 colonial | .0537962 .0489041 1.10 0.274 -.0434721 .1510645 _cons | -1.349589 .8115795 -1.66 0.100 -2.963788 .2646099 ------------------------------------------------------------------------------ . reg price lotsize sqrft bdrms colonial Source | SS df MS Number of obs = 88 -------------+------------------------------ F( 4, 83) = 43.25 Model | 620278.635 4 155069.659 Prob > F = 0.0000 Residual | 297575.871 83 3585.25145 R-squared = 0.6758 -------------+------------------------------ Adj R-squared = 0.6602 Total | 917854.506 87 10550.0518 Root MSE = 59.877 ------------------------------------------------------------------------------ price | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- lotsize | .0020758 .0006427 3.23 0.002 .0007976 .003354 sqrft | .1242375 .0133383 9.31 0.000 .0977082 .1507667 bdrms | 11.00429 9.51526 1.16 0.251 -7.921178 29.92976 colonial | 13.71554 14.63727 0.94 0.351 -15.39739 42.82847 _cons | -24.12653 29.60345 -0.81 0.417 -83.00661 34.75355 ------------------------------------------------------------------------------ . **get the residuals . predict uhat, r . **estimate of variance is uhat squared . gen uhatsq=uhat^2 . **do B-P test . reg uhatsq lotsize sqrft bdrms colonial Source | SS df MS Number of obs = 88 -------------+------------------------------ F( 4, 83) = 4.66 Model | 881739284 4 220434821 Prob > F = 0.0019 Residual | 3.9226e+09 83 47260413.2 R-squared = 0.1835 -------------+------------------------------ Adj R-squared = 0.1442 Total | 4.8044e+09 87 55222454.9 Root MSE = 6874.6 ------------------------------------------------------------------------------ uhatsq | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- lotsize | .2147379 .0737843 2.91 0.005 .0679839 .361492 sqrft | 1.276701 1.531398 0.83 0.407 -1.769188 4.32259 bdrms | 1637.589 1092.47 1.50 0.138 -535.29 3810.469 colonial | -2848.362 1680.54 -1.69 0.094 -6190.888 494.1649 _cons | -4995.03 3398.845 -1.47 0.145 -11755.2 1765.135 ------------------------------------------------------------------------------ . reg lprice llotsize lsqrft bdrms colonial Source | SS df MS Number of obs = 88 -------------+------------------------------ F( 4, 83) = 38.38 Model | 5.20397919 4 1.3009948 Prob > F = 0.0000 Residual | 2.81362433 83 .033899088 R-squared = 0.6491 -------------+------------------------------ Adj R-squared = 0.6322 Total | 8.01760352 87 .092156362 Root MSE = .18412 ------------------------------------------------------------------------------ lprice | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- llotsize | .1678189 .0381807 4.40 0.000 .0918791 .2437587 lsqrft | .7071931 .092802 7.62 0.000 .5226138 .8917725 bdrms | .0268305 .0287236 0.93 0.353 -.0302995 .0839605 colonial | .0537962 .0447732 1.20 0.233 -.0352559 .1428483 _cons | -1.349589 .651041 -2.07 0.041 -2.644483 -.0546947 ------------------------------------------------------------------------------ . predict uhatb, r . gen uhatbsq=uhatb^2 . reg uhatbsq llotsize lsqrft bdrms colonial Source | SS df MS Number of obs = 88 -------------+------------------------------ F( 4, 83) = 1.49 Model | .034587996 4 .008646999 Prob > F = 0.2112 Residual | .480132924 83 .005784734 R-squared = 0.0672 -------------+------------------------------ Adj R-squared = 0.0222 Total | .51472092 87 .005916332 Root MSE = .07606 ------------------------------------------------------------------------------ uhatbsq | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- llotsize | -.0077148 .0157722 -0.49 0.626 -.039085 .0236554 lsqrft | -.0674011 .0383358 -1.76 0.082 -.1436496 .0088473 bdrms | .0218756 .0118655 1.84 0.069 -.0017244 .0454756 colonial | -.0250118 .0184955 -1.35 0.180 -.0617986 .011775 _cons | .5503581 .2689404 2.05 0.044 .0154464 1.08527 ------------------------------------------------------------------------------ . use smoke, clear . reg cigs educ income age Source | SS df MS Number of obs = 807 -------------+------------------------------ F( 3, 803) = 2.81 Model | 1578.01597 3 526.005322 Prob > F = 0.0384 Residual | 150175.667 803 187.018265 R-squared = 0.0104 -------------+------------------------------ Adj R-squared = 0.0067 Total | 151753.683 806 188.280003 Root MSE = 13.675 ------------------------------------------------------------------------------ cigs | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | -.3775954 .1696335 -2.23 0.026 -.7105728 -.044618 income | .0001171 .0000559 2.09 0.036 7.38e-06 .0002268 age | -.0416932 .0287628 -1.45 0.148 -.0981524 .0147659 _cons | 12.85394 2.576089 4.99 0.000 7.79728 17.91061 ------------------------------------------------------------------------------ . predict yhat (option xb assumed; fitted values) . predict uhat, r . **prepare for alternate white test . gen uhatsq=uhat^2 . gen yhatsq=yhat^2 . reg uhatsq yhat yhatsq Source | SS df MS Number of obs = 807 -------------+------------------------------ F( 2, 804) = 0.77 Model | 240434.574 2 120217.287 Prob > F = 0.4638 Residual | 125673980 804 156310.92 R-squared = 0.0019 -------------+------------------------------ Adj R-squared = -0.0006 Total | 125914414 806 156221.358 Root MSE = 395.36 ------------------------------------------------------------------------------ uhatsq | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- yhat | 71.66258 90.49305 0.79 0.429 -105.9679 249.2931 yhatsq | -3.552348 5.207722 -0.68 0.495 -13.77468 6.669988 _cons | -161.4159 388.1718 -0.42 0.678 -923.3656 600.5338 ------------------------------------------------------------------------------ . use saving, clear . reg sav inc Source | SS df MS Number of obs = 100 -------------+------------------------------ F( 1, 98) = 6.49 Model | 66368437.0 1 66368437.0 Prob > F = 0.0124 Residual | 1.0019e+09 98 10223460.8 R-squared = 0.0621 -------------+------------------------------ Adj R-squared = 0.0526 Total | 1.0683e+09 99 10790581.8 Root MSE = 3197.4 ------------------------------------------------------------------------------ sav | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- inc | .1466283 .0575488 2.55 0.012 .0324247 .260832 _cons | 124.8424 655.3931 0.19 0.849 -1175.764 1425.449 ------------------------------------------------------------------------------ . **prepare to transform . gen sqrth=inc^.5 . **make transformed variables . gen newsav=sav/sqrth . gen newinc=inc/sqrth . gen newcons=1/sqrth . **estimate the transformed model . reg newsav newinc newcons, nocons Source | SS df MS Number of obs = 100 -------------+------------------------------ F( 2, 98) = 14.30 Model | 25251.0121 2 12625.506 Prob > F = 0.0000 Residual | 86513.4811 98 882.790623 R-squared = 0.2259 -------------+------------------------------ Adj R-squared = 0.2101 Total | 111764.493 100 1117.64493 Root MSE = 29.712 ------------------------------------------------------------------------------ newsav | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- newinc | .1717555 .0568128 3.02 0.003 .0590124 .2844986 newcons | -124.9528 480.8606 -0.26 0.796 -1079.205 829.2994 ------------------------------------------------------------------------------ . **let stata do wls . reg sav inc [w=1/inc] (analytic weights assumed) (sum of wgt is 1.3877e-02) Source | SS df MS Number of obs = 100 -------------+------------------------------ F( 1, 98) = 9.14 Model | 58142339.8 1 58142339.8 Prob > F = 0.0032 Residual | 623432468 98 6361555.80 R-squared = 0.0853 -------------+------------------------------ Adj R-squared = 0.0760 Total | 681574808 99 6884594.02 Root MSE = 2522.2 ------------------------------------------------------------------------------ sav | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- inc | .1717555 .0568128 3.02 0.003 .0590124 .2844986 _cons | -124.9528 480.8606 -0.26 0.796 -1079.205 829.2994 ------------------------------------------------------------------------------ . log close log: C:\Documents and Settings\Patricia_Anderson\My Documents\ECON 20\I > nClass\oct23.log log type: text closed on: 23 Oct 2002, 12:25:51 -------------------------------------------------------------------------------