-------------------------------------------------------------------------------- log: C:\Documents and Settings\Patricia_Anderson\My Documents\ECON 20\I > nClass\nov15.log log type: text opened on: 15 Nov 2002, 11:16:00 . **read in the tab-delimited text file we just made . insheet using nflqb.txt (13 vars, 60 obs) . sum Variable | Obs Mean Std. Dev. Min Max -------------+----------------------------------------------------- name | 0 salary94 | 60 1104673 961216.8 135000 4025000 valueofbonus | 60 288446.7 388969 0 1666700 practicesq~d | 60 0 0 0 0 passattempts | 60 216.6333 178.7767 1 551 completions | 60 125.9 106.9118 0 348 passingyards | 60 1490.333 1236.925 0 4030 touchdownp~s | 60 7.816667 7.425316 0 29 intercptions | 60 7.083333 6.536188 0 24 ratingpoints | 60 75.11167 18.77627 30.5 118 gamesplay~93 | 54 9.777778 5.023217 1 16 gamesstar~93 | 54 7.333333 6.059454 0 16 nflexperie~e | 54 7.333333 3.756755 2 16 . desc Contains data obs: 60 vars: 13 size: 2,820 (100.0% of memory free) ------------------------------------------------------------------------------- storage display value variable name type format label variable label ------------------------------------------------------------------------------- name str19 %19s Name salary94 long %12.0g Salary '94 valueofbonus long %12.0g Value of Bonus practicesquad byte %8.0g Practice Squad passattempts int %8.0g Pass Attempts completions int %8.0g Completions passingyards int %8.0g Passing Yards touchdownpasses byte %8.0g Touchdown Passes intercptions byte %8.0g Intercptions ratingpoints float %9.0g Rating Points gamesplayed93 byte %8.0g Games Played '93 gamesstarted93 byte %8.0g Games Started '93 nflexperience byte %8.0g NFL Experience ------------------------------------------------------------------------------- Sorted by: Note: dataset has changed since last saved . sum Variable | Obs Mean Std. Dev. Min Max -------------+----------------------------------------------------- name | 0 salary94 | 60 1104673 961216.8 135000 4025000 valueofbonus | 60 288446.7 388969 0 1666700 practicesq~d | 60 0 0 0 0 passattempts | 60 216.6333 178.7767 1 551 completions | 60 125.9 106.9118 0 348 passingyards | 60 1490.333 1236.925 0 4030 touchdownp~s | 60 7.816667 7.425316 0 29 intercptions | 60 7.083333 6.536188 0 24 ratingpoints | 60 75.11167 18.77627 30.5 118 gamesplay~93 | 54 9.777778 5.023217 1 16 gamesstar~93 | 54 7.333333 6.059454 0 16 nflexperie~e | 54 7.333333 3.756755 2 16 . **other data input commands . help input . help infile . help infix . **structural, but maybe biased model . reg lwage educ exper black smsa south reg662-reg669 smsa66, robust variable lwage not found r(111); . use card, clear . reg lwage educ exper black smsa south reg662-reg669 smsa66, robust Regression with robust standard errors Number of obs = 3010 F( 14, 2995) = 91.44 Prob > F = 0.0000 R-squared = 0.2876 Root MSE = .37545 ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .0744579 .0036517 20.39 0.000 .0672977 .081618 exper | .0396377 .0022442 17.66 0.000 .0352374 .0440379 black | -.197546 .0182251 -10.84 0.000 -.2332809 -.1618111 smsa | .1409262 .0193913 7.27 0.000 .1029045 .1789479 south | -.1537098 .0283764 -5.42 0.000 -.209349 -.0980706 reg662 | .0933996 .0355824 2.62 0.009 .0236312 .1631679 reg663 | .1422408 .0343886 4.14 0.000 .0748133 .2096684 reg664 | .0557559 .0415446 1.34 0.180 -.025703 .1372148 reg665 | .127452 .0436462 2.92 0.004 .0418725 .2130315 reg666 | .1369102 .0458691 2.98 0.003 .0469721 .2268483 reg667 | .1227505 .046029 2.67 0.008 .0324989 .2130022 reg668 | -.0531369 .0503807 -1.05 0.292 -.1519212 .0456473 reg669 | .119396 .0392287 3.04 0.002 .0424781 .196314 smsa66 | .0243349 .0187964 1.29 0.196 -.0125203 .0611901 _cons | 4.806222 .0701198 68.54 0.000 4.668734 4.943709 ------------------------------------------------------------------------------ . **first stage . reg educ nearc4 exper black smsa south reg662-reg669 smsa66, robust Regression with robust standard errors Number of obs = 3010 F( 14, 2995) = 236.03 Prob > F = 0.0000 R-squared = 0.4771 Root MSE = 1.9403 ------------------------------------------------------------------------------ | Robust educ | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- nearc4 | .3197029 .0850814 3.76 0.000 .152879 .4865268 exper | -.3954052 .0078768 -50.20 0.000 -.4108497 -.3799607 black | -.936158 .092515 -10.12 0.000 -1.117557 -.7547587 smsa | .4005149 .1108659 3.61 0.000 .1831338 .6178959 south | -.0494358 .1418231 -0.35 0.727 -.3275164 .2286447 reg662 | -.0775155 .185913 -0.42 0.677 -.4420455 .2870146 reg663 | -.0270946 .1793803 -0.15 0.880 -.3788156 .3246265 reg664 | .1169158 .2076233 0.56 0.573 -.290183 .5240146 reg665 | -.2724574 .2242993 -1.21 0.225 -.7122537 .1673389 reg666 | -.3015358 .2368375 -1.27 0.203 -.7659164 .1628448 reg667 | -.2187014 .2391798 -0.91 0.361 -.6876747 .2502718 reg668 | .5226466 .2566482 2.04 0.042 .0194221 1.025871 reg669 | .2099612 .1993534 1.05 0.292 -.1809222 .6008447 smsa66 | .0262844 .1105041 0.24 0.812 -.1903872 .2429561 _cons | 16.56944 .1942088 85.32 0.000 16.18864 16.95023 ------------------------------------------------------------------------------ . predict edhat (option xb assumed; fitted values) . **now run the second stage . reg lwage edhat exper black smsa south reg662-reg669 smsa66, robust Regression with robust standard errors Number of obs = 3010 F( 14, 2995) = 51.53 Prob > F = 0.0000 R-squared = 0.1832 Root MSE = .40203 ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- edhat | .1331522 .0551234 2.42 0.016 .0250687 .2412357 exper | .0628781 .0218874 2.87 0.004 .0199622 .1057939 black | -.143541 .0537993 -2.67 0.008 -.2490284 -.0380536 smsa | .1156311 .0311523 3.71 0.000 .0545489 .1767133 south | -.1504416 .0305589 -4.92 0.000 -.2103602 -.0905231 reg662 | .0978823 .0388644 2.52 0.012 .0216788 .1740858 reg663 | .1460335 .0369192 3.96 0.000 .0736439 .2184231 reg664 | .05042 .0434944 1.16 0.246 -.0348619 .1357018 reg665 | .1462934 .0496575 2.95 0.003 .0489271 .2436596 reg666 | .159962 .053488 2.99 0.003 .0550851 .2648388 reg667 | .1399966 .0522088 2.68 0.007 .0376279 .2423653 reg668 | -.0805922 .0590521 -1.36 0.172 -.1963789 .0351945 reg669 | .1083008 .043309 2.50 0.012 .0233824 .1932192 smsa66 | .0163267 .0224759 0.73 0.468 -.0277431 .0603964 _cons | 3.823837 .9235519 4.14 0.000 2.012977 5.634698 ------------------------------------------------------------------------------ . **Let stata do IV, so we get the right std errors . reg lwage educ exper black smsa south reg662-reg669 smsa66 (nearc4 exper blac > k smsa south reg662-reg669 smsa66), robust IV (2SLS) regression with robust standard errors Number of obs = 3010 F( 14, 2995) = 54.36 Prob > F = 0.0000 R-squared = 0.2218 Root MSE = .39241 ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .1331522 .0547 2.43 0.015 .0258988 .2404055 exper | .0628781 .0216539 2.90 0.004 .02042 .1053361 black | -.143541 .0531141 -2.70 0.007 -.2476847 -.0393973 smsa | .1156311 .0313145 3.69 0.000 .0542311 .1770311 south | -.1504417 .029525 -5.10 0.000 -.208333 -.0925503 reg662 | .0978823 .0371424 2.64 0.008 .0250551 .1707095 reg663 | .1460335 .03628 4.03 0.000 .0748973 .2171697 reg664 | .05042 .0441359 1.14 0.253 -.0361197 .1369596 reg665 | .1462934 .0500382 2.92 0.003 .0481807 .244406 reg666 | .1599619 .0525764 3.04 0.002 .0568724 .2630515 reg667 | .1399966 .051256 2.73 0.006 .039496 .2404972 reg668 | -.0805922 .0572053 -1.41 0.159 -.1927578 .0315734 reg669 | .1083008 .0416766 2.60 0.009 .0265831 .1900185 smsa66 | .0163267 .0207734 0.79 0.432 -.0244049 .0570582 _cons | 3.823838 .9159859 4.17 0.000 2.027813 5.619863 ------------------------------------------------------------------------------ . **do a Hausman test for endogeneity of educ . **run the first stage . reg educ nearc4 exper black smsa south reg662-reg669 smsa66, robust Regression with robust standard errors Number of obs = 3010 F( 14, 2995) = 236.03 Prob > F = 0.0000 R-squared = 0.4771 Root MSE = 1.9403 ------------------------------------------------------------------------------ | Robust educ | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- nearc4 | .3197029 .0850814 3.76 0.000 .152879 .4865268 exper | -.3954052 .0078768 -50.20 0.000 -.4108497 -.3799607 black | -.936158 .092515 -10.12 0.000 -1.117557 -.7547587 smsa | .4005149 .1108659 3.61 0.000 .1831338 .6178959 south | -.0494358 .1418231 -0.35 0.727 -.3275164 .2286447 reg662 | -.0775155 .185913 -0.42 0.677 -.4420455 .2870146 reg663 | -.0270946 .1793803 -0.15 0.880 -.3788156 .3246265 reg664 | .1169158 .2076233 0.56 0.573 -.290183 .5240146 reg665 | -.2724574 .2242993 -1.21 0.225 -.7122537 .1673389 reg666 | -.3015358 .2368375 -1.27 0.203 -.7659164 .1628448 reg667 | -.2187014 .2391798 -0.91 0.361 -.6876747 .2502718 reg668 | .5226466 .2566482 2.04 0.042 .0194221 1.025871 reg669 | .2099612 .1993534 1.05 0.292 -.1809222 .6008447 smsa66 | .0262844 .1105041 0.24 0.812 -.1903872 .2429561 _cons | 16.56944 .1942088 85.32 0.000 16.18864 16.95023 ------------------------------------------------------------------------------ . **get residual . predict uhat, resid . **the test is to check if residual is significant in the structural model . reg lwage educ exper black smsa south reg662-reg669 smsa66 uhat, robust Regression with robust standard errors Number of obs = 3010 F( 15, 2994) = 85.51 Prob > F = 0.0000 R-squared = 0.2879 Root MSE = .37543 ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .1331522 .0519979 2.56 0.010 .031197 .2351073 exper | .0628781 .020607 3.05 0.002 .0224727 .1032835 black | -.143541 .0505865 -2.84 0.005 -.2427288 -.0443532 smsa | .1156311 .029442 3.93 0.000 .0579026 .1733596 south | -.1504416 .0284854 -5.28 0.000 -.2062947 -.0945886 reg662 | .0978823 .0358412 2.73 0.006 .0276065 .1681581 reg663 | .1460335 .0345776 4.22 0.000 .0782352 .2138318 reg664 | .05042 .0416274 1.21 0.226 -.0312011 .1320411 reg665 | .1462934 .0472463 3.10 0.002 .0536549 .2389319 reg666 | .159962 .0501386 3.19 0.001 .0616524 .2582715 reg667 | .1399966 .0489383 2.86 0.004 .0440405 .2359526 reg668 | -.0805922 .0549143 -1.47 0.142 -.1882657 .0270813 reg669 | .1083008 .040186 2.69 0.007 .0295059 .1870957 smsa66 | .0163267 .020219 0.81 0.419 -.0233178 .0559711 uhat | -.0589538 .0522555 -1.13 0.259 -.1614141 .0435064 _cons | 3.823838 .870914 4.39 0.000 2.116187 5.531488 ------------------------------------------------------------------------------ . log close log: C:\Documents and Settings\Patricia_Anderson\My Documents\ECON 20\I > nClass\nov15.log log type: text closed on: 15 Nov 2002, 12:18:55 -------------------------------------------------------------------------------