----------------------------------------------------------------------------------- log: /netscr/khrapov/stata/rec06/rec06.log log type: text opened on: 21 Feb 2008, 08:20:50 . drawnorm e1, n(1000) (obs 1000) . kdensity e1 . drawnorm mu x1 x3 . gen e2=.8*e1+.6*mu . corr e1 e2 (obs=1000) | e1 e2 -------------+------------------ e1 | 1.0000 e2 | 0.8016 1.0000 . gen x2=uniform() . gen x4=uniform() . scalar c1=5 . scalar c2=-5 . scalar a1=1 . scalar a2=2 . scalar b1=-3 . scalar b2=.5 . scalar g=-.5 . gen y1=c1+a1*x1+a2*x2+e1 . gen y2=c2+b1*x3+b2*x4+g*y1+e2 . reg y1 x1 x2 x3 x4 Source | SS df MS Number of obs = 1000 -------------+------------------------------ F( 4, 995) = 343.01 Model | 1334.72981 4 333.682453 Prob > F = 0.0000 Residual | 967.948661 995 .972812725 R-squared = 0.5796 -------------+------------------------------ Adj R-squared = 0.5780 Total | 2302.67847 999 2.30498345 Root MSE = .98631 ------------------------------------------------------------------------------ y1 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x1 | 1.031999 .0316895 32.57 0.000 .9698131 1.094185 x2 | 1.843562 .107718 17.11 0.000 1.632182 2.054943 x3 | .019933 .0299768 0.66 0.506 -.0388919 .078758 x4 | -.0861491 .1099692 -0.78 0.434 -.3019472 .129649 _cons | 5.111259 .085182 60.00 0.000 4.944102 5.278416 ------------------------------------------------------------------------------ . reg y1 x1 x2 Source | SS df MS Number of obs = 1000 -------------+------------------------------ F( 2, 997) = 686.17 Model | 1333.72648 2 666.863238 Prob > F = 0.0000 Residual | 968.951996 997 .971867599 R-squared = 0.5792 -------------+------------------------------ Adj R-squared = 0.5784 Total | 2302.67847 999 2.30498345 Root MSE = .98583 ------------------------------------------------------------------------------ y1 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x1 | 1.033053 .0316441 32.65 0.000 .9709567 1.09515 x2 | 1.850153 .1072708 17.25 0.000 1.63965 2.060655 _cons | 5.066921 .062378 81.23 0.000 4.944513 5.189328 ------------------------------------------------------------------------------ . reg y2 x3 x4 Source | SS df MS Number of obs = 1000 -------------+------------------------------ F( 2, 997) = 6117.05 Model | 9768.87271 2 4884.43635 Prob > F = 0.0000 Residual | 796.09987 997 .798495356 R-squared = 0.9246 -------------+------------------------------ Adj R-squared = 0.9245 Total | 10564.9726 999 10.5755481 Root MSE = .89359 ------------------------------------------------------------------------------ y2 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x3 | -3.000691 .0271327 -110.59 0.000 -3.053935 -2.947448 x4 | .4474826 .0992659 4.51 0.000 .2526885 .6422766 _cons | -7.971513 .0558431 -142.75 0.000 -8.081096 -7.861929 ------------------------------------------------------------------------------ . reg y2 x3 x4 y1 Source | SS df MS Number of obs = 1000 -------------+------------------------------ F( 3, 996) = 4455.72 Model | 9832.35444 3 3277.45148 Prob > F = 0.0000 Residual | 732.618139 996 .73556038 R-squared = 0.9307 -------------+------------------------------ Adj R-squared = 0.9304 Total | 10564.9726 999 10.5755481 Root MSE = .85765 ------------------------------------------------------------------------------ y2 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x3 | -2.990898 .0260628 -114.76 0.000 -3.042043 -2.939754 x4 | .4019073 .0953999 4.21 0.000 .2146995 .5891152 y1 | -.1663856 .0179102 -9.29 0.000 -.2015317 -.1312396 _cons | -6.96075 .1212864 -57.39 0.000 -7.198756 -6.722744 ------------------------------------------------------------------------------ . ivregress 2sls y2 x3 x4 (y1 = x1 x2) Instrumental variables (2SLS) regression Number of obs = 1000 Wald chi2(3) =10032.98 Prob > chi2 = 0.0000 R-squared = 0.9045 Root MSE = 1.0042 ------------------------------------------------------------------------------ y2 | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- y1 | -.5132225 .0275869 -18.60 0.000 -.5672919 -.4591532 x3 | -2.970484 .0305353 -97.28 0.000 -3.030332 -2.910635 x4 | .3069041 .1118119 2.74 0.006 .0877568 .5260515 _cons | -4.853779 .1789506 -27.12 0.000 -5.204516 -4.503042 ------------------------------------------------------------------------------ Instrumented: y1 Instruments: x3 x4 x1 x2 . ivregress gmm y2 x3 x4 (y1 = x1 x2) Instrumental variables (GMM) regression Number of obs = 1000 Wald chi2(3) =10586.90 Prob > chi2 = 0.0000 R-squared = 0.9043 GMM weight matrix: Robust Root MSE = 1.0057 ------------------------------------------------------------------------------ | Robust y2 | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- y1 | -.5150326 .0280439 -18.37 0.000 -.5699976 -.4600675 x3 | -2.969907 .0297025 -99.99 0.000 -3.028123 -2.911691 x4 | .3038773 .1128394 2.69 0.007 .0827161 .5250385 _cons | -4.842296 .1812033 -26.72 0.000 -5.197448 -4.487144 ------------------------------------------------------------------------------ Instrumented: y1 Instruments: x3 x4 x1 x2 . reg y1 x1 x2 x3 x4 Source | SS df MS Number of obs = 1000 -------------+------------------------------ F( 4, 995) = 343.01 Model | 1334.72981 4 333.682453 Prob > F = 0.0000 Residual | 967.948661 995 .972812725 R-squared = 0.5796 -------------+------------------------------ Adj R-squared = 0.5780 Total | 2302.67847 999 2.30498345 Root MSE = .98631 ------------------------------------------------------------------------------ y1 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x1 | 1.031999 .0316895 32.57 0.000 .9698131 1.094185 x2 | 1.843562 .107718 17.11 0.000 1.632182 2.054943 x3 | .019933 .0299768 0.66 0.506 -.0388919 .078758 x4 | -.0861491 .1099692 -0.78 0.434 -.3019472 .129649 _cons | 5.111259 .085182 60.00 0.000 4.944102 5.278416 ------------------------------------------------------------------------------ . predict y1_hat (option xb assumed; fitted values) . reg x3 x1 x2 x4 Source | SS df MS Number of obs = 1000 -------------+------------------------------ F( 3, 996) = 0.83 Model | 2.70747107 3 .902490355 Prob > F = 0.4773 Residual | 1082.57942 996 1.08692713 R-squared = 0.0025 -------------+------------------------------ Adj R-squared = -0.0005 Total | 1085.28689 999 1.08637327 Root MSE = 1.0426 ------------------------------------------------------------------------------ x3 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x1 | .0456173 .0334655 1.36 0.173 -.0200536 .1112882 x2 | -.0232806 .1138583 -0.20 0.838 -.2467103 .200149 x4 | .0883336 .1162065 0.76 0.447 -.1397041 .3163714 _cons | .0082125 .0900392 0.09 0.927 -.1684759 .1849008 ------------------------------------------------------------------------------ . drop y1_hat . reg y1 x1 x2 x3 x4 Source | SS df MS Number of obs = 1000 -------------+------------------------------ F( 4, 995) = 343.01 Model | 1334.72981 4 333.682453 Prob > F = 0.0000 Residual | 967.948661 995 .972812725 R-squared = 0.5796 -------------+------------------------------ Adj R-squared = 0.5780 Total | 2302.67847 999 2.30498345 Root MSE = .98631 ------------------------------------------------------------------------------ y1 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x1 | 1.031999 .0316895 32.57 0.000 .9698131 1.094185 x2 | 1.843562 .107718 17.11 0.000 1.632182 2.054943 x3 | .019933 .0299768 0.66 0.506 -.0388919 .078758 x4 | -.0861491 .1099692 -0.78 0.434 -.3019472 .129649 _cons | 5.111259 .085182 60.00 0.000 4.944102 5.278416 ------------------------------------------------------------------------------ . predict y1_hat (option xb assumed; fitted values) . reg y2 x3 x4 y1_hat Source | SS df MS Number of obs = 1000 -------------+------------------------------ F( 3, 996) = 7513.74 Model | 10117.9058 3 3372.63527 Prob > F = 0.0000 Residual | 447.066758 996 .448862207 R-squared = 0.9577 -------------+------------------------------ Adj R-squared = 0.9576 Total | 10564.9726 999 10.5755481 Root MSE = .66997 ------------------------------------------------------------------------------ y2 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x3 | -2.970484 .0203718 -145.81 0.000 -3.01046 -2.930507 x4 | .3069041 .0745958 4.11 0.000 .1605212 .4532871 y1_hat | -.5132225 .0184047 -27.89 0.000 -.549339 -.4771061 _cons | -4.853779 .1193876 -40.66 0.000 -5.088059 -4.619499 ------------------------------------------------------------------------------ . ivregress 2sls y2 x3 x4 (y1 = x1 x2) Instrumental variables (2SLS) regression Number of obs = 1000 Wald chi2(3) =10032.98 Prob > chi2 = 0.0000 R-squared = 0.9045 Root MSE = 1.0042 ------------------------------------------------------------------------------ y2 | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- y1 | -.5132225 .0275869 -18.60 0.000 -.5672919 -.4591532 x3 | -2.970484 .0305353 -97.28 0.000 -3.030332 -2.910635 x4 | .3069041 .1118119 2.74 0.006 .0877568 .5260515 _cons | -4.853779 .1789506 -27.12 0.000 -5.204516 -4.503042 ------------------------------------------------------------------------------ Instrumented: y1 Instruments: x3 x4 x1 x2 . do klein . clear . use klein . tsset Year time variable: Year, 1920 to 1941 delta: 1 unit . reg C P L.P Wp Wg Source | SS df MS Number of obs = 21 -------------+------------------------------ F( 4, 16) = 268.02 Model | 927.585925 4 231.896481 Prob > F = 0.0000 Residual | 13.8434638 16 .865216489 R-squared = 0.9853 -------------+------------------------------ Adj R-squared = 0.9816 Total | 941.429389 20 47.0714695 Root MSE = .93017 ------------------------------------------------------------------------------ C | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- P | --. | .329213 .1040447 3.16 0.006 .1086481 .5497778 L1. | .3353412 .1402702 2.39 0.029 .0379817 .6327006 Wp | .5055224 .1393852 3.63 0.002 .2100389 .8010059 Wg | 1.40402 .2837387 4.95 0.000 .8025205 2.005519 _cons | 17.37406 1.293612 13.43 0.000 14.63173 20.1164 ------------------------------------------------------------------------------ . ivregress 2sls C P L.P Wg (Wp=P L.P L.K1 X L.X) Instrumental variables (2SLS) regression Number of obs = 21 Wald chi2(4) = 1297.52 Prob > chi2 = 0.0000 R-squared = 0.9840 Root MSE = .84775 ------------------------------------------------------------------------------ C | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Wp | .6729877 .1413015 4.76 0.000 .3960418 .9499336 P | --. | .2466568 .0996107 2.48 0.013 .0514234 .4418902 L1. | .1987323 .1374442 1.45 0.148 -.0706534 .4681181 Wg | 1.088845 .2836066 3.84 0.000 .5329866 1.644704 _cons | 16.52964 1.219572 13.55 0.000 14.13932 18.91996 ------------------------------------------------------------------------------ Instrumented: Wp Instruments: P L.P Wg L.K1 X L.X . reg I P L.P L.K1 Source | SS df MS Number of obs = 21 -------------+------------------------------ F( 3, 17) = 76.00 Model | 234.81758 3 78.2725265 Prob > F = 0.0000 Residual | 17.509079 17 1.02994582 R-squared = 0.9306 -------------+------------------------------ Adj R-squared = 0.9184 Total | 252.326659 20 12.6163329 Root MSE = 1.0149 ------------------------------------------------------------------------------ I | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- P | --. | .5145179 .0937567 5.49 0.000 .3167086 .7123272 L1. | .2256043 .0914703 2.47 0.025 .0326189 .4185897 K1 | L1. | -.0977403 .0236166 -4.14 0.001 -.147567 -.0479136 _cons | 8.364566 5.1049 1.64 0.120 -2.405832 19.13496 ------------------------------------------------------------------------------ . reg Wp X L.X Year Source | SS df MS Number of obs = 21 -------------+------------------------------ F( 3, 17) = 444.57 Model | 784.904754 3 261.634918 Prob > F = 0.0000 Residual | 10.0047374 17 .588513967 R-squared = 0.9874 -------------+------------------------------ Adj R-squared = 0.9852 Total | 794.909491 20 39.7454746 Root MSE = .76715 ------------------------------------------------------------------------------ Wp | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- X | --. | .4394769 .0324076 13.56 0.000 .371103 .5078509 L1. | .14609 .0374231 3.90 0.001 .0671341 .2250458 Year | .1302452 .0319103 4.08 0.001 .0629203 .19757 _cons | -250.0064 61.0458 -4.10 0.001 -378.8018 -121.211 ------------------------------------------------------------------------------ . end of do-file . log close log: /netscr/khrapov/stata/rec06/rec06.log log type: text closed on: 21 Feb 2008, 09:22:01 -----------------------------------------------------------------------------------