-------------------------------------------------------------------------------- log: C:\Documents and Settings\Patricia_Anderson\My Documents\ECON 20\In > Class\nov20.log log type: text opened on: 20 Nov 2002, 11:11:49 . use fish . desc Contains data from fish.dta obs: 97 vars: 20 19 Nov 2001 23:15 size: 5,529 (100.0% of memory free) ------------------------------------------------------------------------------- storage display value variable name type format label variable label ------------------------------------------------------------------------------- prca float %9.0g price for Asian buyers prcw float %9.0g price for white buyers qtya int %9.0g quantity sold to Asians qtyw int %9.0g quantity sold to whites mon byte %9.0g =1 if Monday tues byte %9.0g =1 if Tuesday wed byte %9.0g =1 if Wednesday thurs byte %9.0g =1 if Thursday speed2 byte %9.0g min past 2 days wind speeds wave2 float %9.0g avg max last 2 days wave height speed3 byte %9.0g 3 day lagged max windspeed wave3 float %9.0g avg max wave hghts of 3 & 4 day lagged hghts avgprc float %9.0g ((prca*qtya) + (prcw*qtyw))/(qtya + qtyw) totqty int %9.0g qtya + qtyw lavgprc float %9.0g log(avgprc) ltotqty float %9.0g log(totqty) t byte %9.0g time trend lavgp_1 float %9.0g lavgprc[_n-1] gavgprc float %9.0g lavgprc - lavgp_1 gavgp_1 float %9.0g gavgprc[_n-1] ------------------------------------------------------------------------------- Sorted by: . **just estimate qty as a function price . reg ltotqty lavgprc mon-thurs, robust Regression with robust standard errors Number of obs = 97 F( 5, 91) = 8.63 Prob > F = 0.0000 R-squared = 0.2168 Root MSE = .69504 ------------------------------------------------------------------------------ | Robust ltotqty | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- lavgprc | -.5246553 .161579 -3.25 0.002 -.8456122 -.2036984 mon | -.3109272 .2445861 -1.27 0.207 -.7967674 .174913 tues | -.6827901 .2044422 -3.34 0.001 -1.08889 -.2766908 wed | -.5338939 .2133237 -2.50 0.014 -.9576352 -.1101525 thurs | .0672273 .1656234 0.41 0.686 -.2617633 .3962178 _cons | 8.244317 .1345196 61.29 0.000 7.977111 8.511524 ------------------------------------------------------------------------------ . **use weather as instruments . **first stage . reg lavgprc wave2 wave3 mon-thurs, robust Regression with robust standard errors Number of obs = 97 F( 6, 90) = 9.31 Prob > F = 0.0000 R-squared = 0.3041 Root MSE = .34856 ------------------------------------------------------------------------------ | Robust lavgprc | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- wave2 | .0944805 .0180429 5.24 0.000 .0586352 .1303258 wave3 | .052566 .0168191 3.13 0.002 .0191519 .0859801 mon | -.0120799 .1148977 -0.11 0.917 -.2403442 .2161843 tues | -.0089759 .1221166 -0.07 0.942 -.2515817 .23363 wed | .050547 .1113689 0.45 0.651 -.1707067 .2718008 thurs | .1241912 .1030767 1.20 0.231 -.0805886 .328971 _cons | -1.022801 .136276 -7.51 0.000 -1.293537 -.7520651 ------------------------------------------------------------------------------ . **instruments are signif, let's do IV . reg ltotqty lavgprc mon-thurs (wave2 wave3 mon-thurs), robust IV (2SLS) regression with robust standard errors Number of obs = 97 F( 5, 91) = 5.60 Prob > F = 0.0002 R-squared = 0.1933 Root MSE = .7054 ------------------------------------------------------------------------------ | Robust ltotqty | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- lavgprc | -.8158181 .3339217 -2.44 0.016 -1.479113 -.1525237 mon | -.3074355 .2451643 -1.25 0.213 -.7944243 .1795534 tues | -.6847291 .2070528 -3.31 0.001 -1.096014 -.2734442 wed | -.5206143 .2195381 -2.37 0.020 -.9566999 -.0845288 thurs | .0947568 .1701184 0.56 0.579 -.2431626 .4326762 _cons | 8.164099 .1620339 50.39 0.000 7.842239 8.48596 ------------------------------------------------------------------------------ . use openness, clear . ***naive view of inflation and openness . reg inf open lpcinc Source | SS df MS Number of obs = 114 -------------+------------------------------ F( 2, 111) = 2.63 Model | 2945.92811 2 1472.96406 Prob > F = 0.0764 Residual | 62127.4936 111 559.70715 R-squared = 0.0453 -------------+------------------------------ Adj R-squared = 0.0281 Total | 65073.4217 113 575.870989 Root MSE = 23.658 ------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- open | -.2150695 .0946289 -2.27 0.025 -.402583 -.027556 lpcinc | .0175673 1.975267 0.01 0.993 -3.896557 3.931691 _cons | 25.10404 15.20522 1.65 0.102 -5.026116 55.2342 ------------------------------------------------------------------------------ . reg open inf lpcinc lland Source | SS df MS Number of obs = 114 -------------+------------------------------ F( 3, 110) = 30.39 Model | 28892.7304 3 9630.91013 Prob > F = 0.0000 Residual | 34865.2599 110 316.956908 R-squared = 0.4532 -------------+------------------------------ Adj R-squared = 0.4382 Total | 63757.9902 113 564.230002 Root MSE = 17.803 ------------------------------------------------------------------------------ open | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- inf | -.0680353 .0715556 -0.95 0.344 -.2098416 .0737711 lpcinc | .5595009 1.493948 0.37 0.709 -2.401154 3.520156 lland | -7.393355 .8348144 -8.86 0.000 -9.047761 -5.738949 _cons | 116.2263 15.88083 7.32 0.000 84.75418 147.6983 ------------------------------------------------------------------------------ . **estimate reduced form . reg inf lpcinc lland Source | SS df MS Number of obs = 114 -------------+------------------------------ F( 2, 111) = 2.84 Model | 3170.20851 2 1585.10425 Prob > F = 0.0625 Residual | 61903.2132 111 557.686606 R-squared = 0.0487 -------------+------------------------------ Adj R-squared = 0.0316 Total | 65073.4217 113 575.870989 Root MSE = 23.615 ------------------------------------------------------------------------------ inf | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- lpcinc | .1913935 1.981583 0.10 0.923 -3.735246 4.118033 lland | 2.553798 1.080495 2.36 0.020 .4127261 4.69487 _cons | -12.61515 21.03127 -0.60 0.550 -54.29002 29.05971 ------------------------------------------------------------------------------ . predict infhat (option xb assumed; fitted values) . reg open lpcinc lland Source | SS df MS Number of obs = 114 -------------+------------------------------ F( 2, 111) = 45.17 Model | 28606.193 2 14303.0965 Prob > F = 0.0000 Residual | 35151.7973 111 316.682858 R-squared = 0.4487 -------------+------------------------------ Adj R-squared = 0.4387 Total | 63757.9902 113 564.230002 Root MSE = 17.796 ------------------------------------------------------------------------------ open | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- lpcinc | .5464794 1.49324 0.37 0.715 -2.412475 3.505433 lland | -7.567103 .8142162 -9.29 0.000 -9.180527 -5.953679 _cons | 117.0845 15.8483 7.39 0.000 85.68007 148.489 ------------------------------------------------------------------------------ . predict openhat (option xb assumed; fitted values) . ***try 2sls by hand . reg inf openhat lpcinc, robust Regression with robust standard errors Number of obs = 114 F( 2, 111) = 2.79 Prob > F = 0.0657 R-squared = 0.0487 Root MSE = 23.615 ------------------------------------------------------------------------------ | Robust inf | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- openhat | -.3374869 .1476898 -2.29 0.024 -.630144 -.0448297 lpcinc | .3758232 1.335329 0.28 0.779 -2.270221 3.021867 _cons | 26.89934 10.21428 2.63 0.010 6.65907 47.13961 ------------------------------------------------------------------------------ . **stupidly try 2sls on 2nd model . reg open infhat lpcinc lland, robust Regression with robust standard errors Number of obs = 114 F( 2, 111) = 22.22 Prob > F = 0.0000 R-squared = 0.4487 Root MSE = 17.796 ------------------------------------------------------------------------------ | Robust open | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- infhat | -2.963078 .4470981 -6.63 0.000 -3.849033 -2.077124 lpcinc | 1.113593 1.434371 0.78 0.439 -1.728709 3.955896 lland | (dropped) _cons | 79.70485 14.3357 5.56 0.000 51.29771 108.112 ------------------------------------------------------------------------------ . **can only do the first . reg inf open lpcinc (lland lpcinc), robust IV (2SLS) regression with robust standard errors Number of obs = 114 F( 2, 111) = 2.53 Prob > F = 0.0844 R-squared = 0.0309 Root MSE = 23.836 ------------------------------------------------------------------------------ | Robust inf | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- open | -.3374869 .1524488 -2.21 0.029 -.6395744 -.0353993 lpcinc | .3758232 1.378542 0.27 0.786 -2.35585 3.107496 _cons | 26.89934 10.9199 2.46 0.015 5.260824 48.53786 ------------------------------------------------------------------------------ . **compare to OLS . reg inf open lpcinc, robust Regression with robust standard errors Number of obs = 114 F( 2, 111) = 3.84 Prob > F = 0.0243 R-squared = 0.0453 Root MSE = 23.658 ------------------------------------------------------------------------------ | Robust inf | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- open | -.2150695 .0794571 -2.71 0.008 -.3725191 -.0576199 lpcinc | .0175673 1.278747 0.01 0.989 -2.516355 2.55149 _cons | 25.10404 9.990783 2.51 0.013 5.306639 44.90144 ------------------------------------------------------------------------------ . use mroz, clear . **OLS labor supply . reg hours lwage educ age kidslt6 nwifeinc, robust Regression with robust standard errors Number of obs = 428 F( 5, 422) = 2.46 Prob > F = 0.0324 R-squared = 0.0361 Root MSE = 766.63 ------------------------------------------------------------------------------ | Robust hours | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- lwage | -2.0468 82.02275 -0.02 0.980 -163.2708 159.1772 educ | -6.621869 18.43784 -0.36 0.720 -42.8633 29.61957 age | .562254 5.360839 0.10 0.917 -9.975019 11.09953 kidslt6 | -328.8584 126.681 -2.60 0.010 -577.8629 -79.854 nwifeinc | -5.918458 3.385146 -1.75 0.081 -12.57231 .7353889 _cons | 1523.775 309.4226 4.92 0.000 915.5735 2131.976 ------------------------------------------------------------------------------ . OLS wage offer unrecognized command: OLS r(199); . reg lwage hours educ exper expersq, robust Regression with robust standard errors Number of obs = 428 F( 4, 423) = 20.24 Prob > F = 0.0000 R-squared = 0.1601 Root MSE = .6659 ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- hours | -.0000565 .0000654 -0.86 0.388 -.0001852 .0000721 educ | .1062139 .0133269 7.97 0.000 .0800187 .1324091 exper | .0447035 .0152503 2.93 0.004 .0147277 .0746793 expersq | -.0008585 .0004166 -2.06 0.040 -.0016773 -.0000397 _cons | -.4619956 .2113448 -2.19 0.029 -.8774125 -.0465787 ------------------------------------------------------------------------------ . **check the first stages . reg lwage educ age kidslt6 nwifeinc exper expersq, robust Regression with robust standard errors Number of obs = 428 F( 6, 421) = 14.76 Prob > F = 0.0000 R-squared = 0.1633 Root MSE = .66622 ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .1011113 .0141358 7.15 0.000 .0733257 .128897 age | -.0025561 .0059149 -0.43 0.666 -.0141826 .0090704 kidslt6 | -.0532185 .1047899 -0.51 0.612 -.2591951 .152758 nwifeinc | .00556 .0027435 2.03 0.043 .0001673 .0109527 exper | .0418643 .0151135 2.77 0.006 .0121569 .0715718 expersq | -.0007625 .0004065 -1.88 0.061 -.0015614 .0000365 _cons | -.4471609 .2889008 -1.55 0.122 -1.015029 .1207068 ------------------------------------------------------------------------------ . test exper expersq ( 1) exper = 0.0 ( 2) expersq = 0.0 F( 2, 421) = 6.17 Prob > F = 0.0023 . reg hours educ age kidslt6 nwifeinc exper expersq, robust Regression with robust standard errors Number of obs = 753 F( 6, 746) = 53.24 Prob > F = 0.0000 R-squared = 0.2637 Root MSE = 750.68 ------------------------------------------------------------------------------ | Robust hours | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | 30.55099 13.08175 2.34 0.020 4.869567 56.2324 age | -28.41577 3.938388 -7.22 0.000 -36.14742 -20.68413 kidslt6 | -432.9073 55.31723 -7.83 0.000 -541.5033 -324.3113 nwifeinc | -3.624902 2.245939 -1.61 0.107 -8.034015 .7842115 exper | 66.76674 10.76061 6.20 0.000 45.64206 87.89141 expersq | -.7056908 .3729094 -1.89 0.059 -1.437768 .0263859 _cons | 1165.677 249.8412 4.67 0.000 675.2013 1656.152 ------------------------------------------------------------------------------ . test age kidslt6 nwifeinc ( 1) age = 0.0 ( 2) kidslt6 = 0.0 ( 3) nwifeinc = 0.0 F( 3, 746) = 28.38 Prob > F = 0.0000 . **can do both by IV . reg hours lwage educ age kidslt6 nwifeinc (educ age kidslt6 nwifeinc exper ex > persq), robust IV (2SLS) regression with robust standard errors Number of obs = 428 F( 5, 422) = 2.49 Prob > F = 0.0310 R-squared = . Root MSE = 1354.2 ------------------------------------------------------------------------------ | Robust hours | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- lwage | 1639.556 597.5137 2.74 0.006 465.0819 2814.029 educ | -183.7513 68.26762 -2.69 0.007 -317.9382 -49.56438 age | -7.806094 10.56176 -0.74 0.460 -28.5663 12.95411 kidslt6 | -198.1543 209.9012 -0.94 0.346 -610.7363 214.4277 nwifeinc | -10.16959 5.324942 -1.91 0.057 -20.6363 .2971226 _cons | 2225.662 607.3687 3.66 0.000 1031.817 3419.507 ------------------------------------------------------------------------------ . reg lwage hours educ exper expersq (educ age kidslt6 nwifeinc exper expersq), > robust IV (2SLS) regression with robust standard errors Number of obs = 428 F( 4, 423) = 20.65 Prob > F = 0.0000 R-squared = 0.1257 Root MSE = .67943 ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- hours | .0001259 .0002941 0.43 0.669 -.0004523 .0007041 educ | .11033 .0149051 7.40 0.000 .0810327 .1396273 exper | .0345824 .0186143 1.86 0.064 -.0020056 .0711703 expersq | -.0007058 .000429 -1.64 0.101 -.0015491 .0001376 _cons | -.6557256 .4121801 -1.59 0.112 -1.465902 .1544507 ------------------------------------------------------------------------------ . **do OLS just on lwage . reg lwage educ exper expersq, robust Regression with robust standard errors Number of obs = 428 F( 3, 424) = 27.30 Prob > F = 0.0000 R-squared = 0.1568 Root MSE = .66642 ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .1074896 .013219 8.13 0.000 .0815068 .1334725 exper | .0415665 .015273 2.72 0.007 .0115462 .0715868 expersq | -.0008112 .0004201 -1.93 0.054 -.0016369 .0000145 _cons | -.5220407 .2016505 -2.59 0.010 -.9183997 -.1256817 ------------------------------------------------------------------------------ . **re-do as a heckman selection correction . heckman lwage educ exper expersq, select(nwifeinc age kidslt6 educ exper expe > rsq) two Heckman selection model -- two-step estimates Number of obs = 753 (regression model with sample selection) Censored obs = 325 Uncensored obs = 428 Wald chi2(6) = 182.63 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- lwage | educ | .1091941 .0155235 7.03 0.000 .0787687 .1396195 exper | .0440953 .0163034 2.70 0.007 .0121411 .0760494 expersq | -.0008635 .0004397 -1.96 0.050 -.0017254 -1.61e-06 _cons | -.5827993 .3053666 -1.91 0.056 -1.181307 .0157082 -------------+---------------------------------------------------------------- select | nwifeinc | -.0118298 .0048357 -2.45 0.014 -.0213077 -.0023519 age | -.0553178 .0079581 -6.95 0.000 -.0709154 -.0397202 kidslt6 | -.8809003 .11776 -7.48 0.000 -1.111706 -.650095 educ | .1286938 .0250943 5.13 0.000 .0795099 .1778778 exper | .1221105 .018644 6.55 0.000 .0855689 .1586521 expersq | -.0018828 .0005999 -3.14 0.002 -.0030586 -.0007069 _cons | .4633524 .4522318 1.02 0.306 -.4230055 1.34971 -------------+---------------------------------------------------------------- mills | lambda | .0348435 .1334299 0.26 0.794 -.2266742 .2963612 -------------+---------------------------------------------------------------- rho | 0.05250 sigma | .66368341 lambda | .03484348 .1334299 ------------------------------------------------------------------------------ . log close log: C:\Documents and Settings\Patricia_Anderson\My Documents\ECON 20\I > nClass\nov20.log log type: text closed on: 20 Nov 2002, 12:19:36 -------------------------------------------------------------------------------