-------------------------------------------------------------------------------- log: C:\Documents and Settings\Patricia_Anderson\My Documents\ECON 20\I > nClass\nov4.log log type: text opened on: 4 Nov 2002, 11:10:09 . graph using midterm.gph . use wage1 . reg lsalary educ exper variable lsalary not found r(111); . reg lwage educ exper Source | SS df MS Number of obs = 526 -------------+------------------------------ F( 2, 523) = 86.86 Model | 36.9850408 2 18.4925204 Prob > F = 0.0000 Residual | 111.344721 523 .212896216 R-squared = 0.2493 -------------+------------------------------ Adj R-squared = 0.2465 Total | 148.329762 525 .28253288 Root MSE = .46141 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .0979356 .0076224 12.85 0.000 .0829613 .1129099 exper | .0103469 .0015551 6.65 0.000 .0072919 .013402 _cons | .2168543 .108595 2.00 0.046 .0035183 .4301904 ------------------------------------------------------------------------------ . **separate men and women, because less error for men probably . reg lwage educ exper if female==0 Source | SS df MS Number of obs = 274 -------------+------------------------------ F( 2, 271) = 61.04 Model | 24.2519537 2 12.1259769 Prob > F = 0.0000 Residual | 53.8321966 271 .198642792 R-squared = 0.3106 -------------+------------------------------ Adj R-squared = 0.3055 Total | 78.0841503 273 .286022529 Root MSE = .44569 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .1018128 .009656 10.54 0.000 .0828024 .1208231 exper | .0149081 .0021479 6.94 0.000 .0106795 .0191367 _cons | .2497944 .1442639 1.73 0.084 -.0342262 .5338149 ------------------------------------------------------------------------------ . reg lwage educ exper if female==1 Source | SS df MS Number of obs = 252 -------------+------------------------------ F( 2, 249) = 31.06 Model | 9.88926291 2 4.94463146 Prob > F = 0.0000 Residual | 39.6443489 249 .159214253 R-squared = 0.1996 -------------+------------------------------ Adj R-squared = 0.1932 Total | 49.5336118 251 .197345067 Root MSE = .39902 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | .0823141 .0104578 7.87 0.000 .0617169 .1029112 exper | .0041158 .001894 2.17 0.031 .0003855 .0078461 _cons | .3348362 .141456 2.37 0.019 .0562334 .6134389 ------------------------------------------------------------------------------ . use ceosal2 . reg lsalary age college comten ceoten profmarg Source | SS df MS Number of obs = 177 -------------+------------------------------ F( 5, 171) = 0.97 Model | 1.78236811 5 .356473621 Prob > F = 0.4379 Residual | 62.8638534 171 .367624874 R-squared = 0.0276 -------------+------------------------------ Adj R-squared = -0.0009 Total | 64.6462215 176 .367308077 Root MSE = .60632 ------------------------------------------------------------------------------ lsalary | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0060934 .0063852 0.95 0.341 -.0065106 .0186974 college | -.1911877 .280691 -0.68 0.497 -.7452533 .3628778 comten | -.0040775 .0043254 -0.94 0.347 -.0126155 .0044605 ceoten | .0092898 .0069215 1.34 0.181 -.0043729 .0229524 profmarg | -.0021337 .0025639 -0.83 0.406 -.0071947 .0029272 _cons | 6.456341 .4541931 14.21 0.000 5.559794 7.352889 ------------------------------------------------------------------------------ . predict yhat (option xb assumed; fitted values) . gen yhatsq=yhat^2 . gen yhatcub=yhat^3 . **Ramsey RESET . reg lsalary age college comten ceoten profmarg yhatsq yhatcub Source | SS df MS Number of obs = 177 -------------+------------------------------ F( 7, 169) = 2.84 Model | 6.80823837 7 .972605481 Prob > F = 0.0079 Residual | 57.8379832 169 .342236587 R-squared = 0.1053 -------------+------------------------------ Adj R-squared = 0.0683 Total | 64.6462215 176 .367308077 Root MSE = .58501 ------------------------------------------------------------------------------ lsalary | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | -15.15976 15.97131 -0.95 0.344 -46.68874 16.36922 college | 475.1425 501.1141 0.95 0.344 -514.107 1464.392 comten | 10.14543 10.68719 0.95 0.344 -10.95217 31.24302 ceoten | -23.10673 24.34998 -0.95 0.344 -71.17603 24.96257 profmarg | 5.30025 5.591375 0.95 0.345 -5.737686 16.33819 yhatsq | 385.4918 393.0241 0.98 0.328 -390.3772 1161.361 yhatcub | -19.88879 19.64006 -1.01 0.313 -58.66023 18.88265 _cons | -10709.48 11097.47 -0.97 0.336 -32616.99 11198.04 ------------------------------------------------------------------------------ . test yhatsq yhatcub ( 1) yhatsq = 0.0 ( 2) yhatcub = 0.0 F( 2, 169) = 7.34 Prob > F = 0.0009 . **maybe is quadratic . reg lsalary age college comten ceoten profmarg ceotensq comtensq Source | SS df MS Number of obs = 177 -------------+------------------------------ F( 7, 169) = 1.46 Model | 3.67938289 7 .525626127 Prob > F = 0.1858 Residual | 60.9668387 169 .360750525 R-squared = 0.0569 -------------+------------------------------ Adj R-squared = 0.0179 Total | 64.6462215 176 .367308077 Root MSE = .60063 ------------------------------------------------------------------------------ lsalary | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0078539 .006466 1.21 0.226 -.0049106 .0206183 college | -.1586962 .2787804 -0.57 0.570 -.7090367 .3916443 comten | .0130505 .0143629 0.91 0.365 -.0153033 .0414044 ceoten | .0363473 .0175334 2.07 0.040 .0017346 .0709599 profmarg | -.002533 .0025462 -0.99 0.321 -.0075594 .0024933 ceotensq | -.0009785 .000593 -1.65 0.101 -.0021491 .0001922 comtensq | -.000377 .0003152 -1.20 0.233 -.0009992 .0002453 _cons | 6.086528 .486358 12.51 0.000 5.126408 7.046648 ------------------------------------------------------------------------------ . **repeat RESET . predict newyhat (option xb assumed; fitted values) . gen newyhatsq=newyhat^2 . gen newyhatcub=newyhat^3 . reg lsalary age college comten ceoten profmarg ceotensq comtensq newyhatsq ne > wyhatcub Source | SS df MS Number of obs = 177 -------------+------------------------------ F( 9, 167) = 1.44 Model | 4.66220049 9 .518022276 Prob > F = 0.1738 Residual | 59.9840211 167 .359185755 R-squared = 0.0721 -------------+------------------------------ Adj R-squared = 0.0221 Total | 64.6462215 176 .367308077 Root MSE = .59932 ------------------------------------------------------------------------------ lsalary | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | 8.211411 10.75835 0.76 0.446 -13.0285 29.45132 college | -165.9755 217.3927 -0.76 0.446 -595.1676 263.2166 comten | 13.63943 17.87581 0.76 0.447 -21.65226 48.93111 ceoten | 37.99597 49.79775 0.76 0.447 -60.31827 136.3102 profmarg | -2.648734 3.46978 -0.76 0.446 -9.499019 4.201551 ceotensq | -1.022685 1.340468 -0.76 0.447 -3.669133 1.623763 comtensq | -.393994 .5163302 -0.76 0.447 -1.41337 .6253816 newyhatsq | -154.9683 207.2359 -0.75 0.456 -564.1082 254.1716 newyhatcub | 7.658268 10.44663 0.73 0.465 -12.9662 28.28274 _cons | 4018.623 5320.667 0.76 0.451 -6485.816 14523.06 ------------------------------------------------------------------------------ . test newyhatsq newyhatcub ( 1) newyhatsq = 0.0 ( 2) newyhatcub = 0.0 F( 2, 167) = 1.37 Prob > F = 0.2574 . **model a . reg lsalary ceoten ceotensq profits sales mktval Source | SS df MS Number of obs = 177 -------------+------------------------------ F( 5, 171) = 10.14 Model | 14.7845664 5 2.95691327 Prob > F = 0.0000 Residual | 49.8616552 171 .291588627 R-squared = 0.2287 -------------+------------------------------ Adj R-squared = 0.2061 Total | 64.6462215 176 .367308077 Root MSE = .53999 ------------------------------------------------------------------------------ lsalary | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- ceoten | .0434857 .0153681 2.83 0.005 .0131501 .0738213 ceotensq | -.0011705 .0005164 -2.27 0.025 -.0021898 -.0001512 profits | .0000529 .0002782 0.19 0.849 -.0004963 .0006021 sales | .0000258 .0000112 2.31 0.022 3.71e-06 .0000479 mktval | .0000165 .0000161 1.03 0.305 -.0000152 .0000482 _cons | 6.208905 .0860737 72.13 0.000 6.039001 6.378808 ------------------------------------------------------------------------------ . predict yhata (option xb assumed; fitted values) . **model b uses profit margin instead of profits and sales and lmktval instead > of level . reg lsalary ceoten ceotensq profmarg lmktval Source | SS df MS Number of obs = 177 -------------+------------------------------ F( 4, 172) = 17.13 Model | 18.4164661 4 4.60411653 Prob > F = 0.0000 Residual | 46.2297554 172 .268777648 R-squared = 0.2849 -------------+------------------------------ Adj R-squared = 0.2683 Total | 64.6462215 176 .367308077 Root MSE = .51844 ------------------------------------------------------------------------------ lsalary | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- ceoten | .0458656 .0147722 3.10 0.002 .0167074 .0750238 ceotensq | -.0012272 .0004963 -2.47 0.014 -.0022068 -.0002477 profmarg | -.0036192 .0021997 -1.65 0.102 -.0079611 .0007226 lmktval | .2651684 .0345842 7.67 0.000 .1969043 .3334325 _cons | 4.4192 .2696015 16.39 0.000 3.887047 4.951354 ------------------------------------------------------------------------------ . predict yhatb (option xb assumed; fitted values) . **put yhatb in model a . reg lsalary ceoten ceotensq profits sales mktval yhatb Source | SS df MS Number of obs = 177 -------------+------------------------------ F( 6, 170) = 12.13 Model | 19.3778677 6 3.22964462 Prob > F = 0.0000 Residual | 45.2683538 170 .266284434 R-squared = 0.2998 -------------+------------------------------ Adj R-squared = 0.2750 Total | 64.6462215 176 .367308077 Root MSE = .51603 ------------------------------------------------------------------------------ lsalary | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- ceoten | .0062417 .0172074 0.36 0.717 -.027726 .0402095 ceotensq | -.000143 .000552 -0.26 0.796 -.0012326 .0009467 profits | .0000555 .0002659 0.21 0.835 -.0004693 .0005803 sales | .0000178 .0000109 1.64 0.103 -3.66e-06 .0000393 mktval | -.0000106 .0000167 -0.64 0.525 -.0000436 .0000223 yhatb | .8829328 .2125877 4.15 0.000 .4632812 1.302584 _cons | .7012657 1.328647 0.53 0.598 -1.921506 3.324038 ------------------------------------------------------------------------------ . **do it the other way with yhata in modelb . reg lsalary ceoten ceotensq profmarg lmktval yhata Source | SS df MS Number of obs = 177 -------------+------------------------------ F( 5, 171) = 14.16 Model | 18.9269448 5 3.78538896 Prob > F = 0.0000 Residual | 45.7192767 171 .267364191 R-squared = 0.2928 -------------+------------------------------ Adj R-squared = 0.2721 Total | 64.6462215 176 .367308077 Root MSE = .51707 ------------------------------------------------------------------------------ lsalary | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- ceoten | .0318168 .0179009 1.78 0.077 -.0035185 .067152 ceotensq | -.0008482 .0005659 -1.50 0.136 -.0019653 .0002688 profmarg | -.0035178 .0021951 -1.60 0.111 -.0078508 .0008153 lmktval | .205047 .0555241 3.69 0.000 .0954461 .3146478 yhata | .3250582 .2352469 1.38 0.169 -.1393037 .78942 _cons | 2.792104 1.207852 2.31 0.022 .4078842 5.176324 ------------------------------------------------------------------------------ . **go with model b . use pntsprd, clear . desc Contains data from pntsprd.dta obs: 553 vars: 12 13 Sep 2000 15:34 size: 11,060 (100.0% of memory free) ------------------------------------------------------------------------------- storage display value variable name type format label variable label ------------------------------------------------------------------------------- favscr int %9.0g favored team's score undscr byte %9.0g underdog's score spread float %9.0g Las Vegas spread favhome byte %9.0g =1 if favored team at home neutral byte %9.0g =1 if neutral site fav25 byte %9.0g =1 if favored team in top 25 und25 byte %9.0g =1 if underdog in top 25 fregion byte %9.0g favorite's region of country uregion byte %9.0g underdog's region of country scrdiff byte %9.0g favscr - undscr sprdcvr byte %9.0g =1 if spread covered favwin byte %9.0g =1 if favored team wins ------------------------------------------------------------------------------- Sorted by: . **lpm . reg favwin spread Source | SS df MS Number of obs = 553 -------------+------------------------------ F( 1, 551) = 68.57 Model | 11.0636261 1 11.0636261 Prob > F = 0.0000 Residual | 88.9038241 551 .161349953 R-squared = 0.1107 -------------+------------------------------ Adj R-squared = 0.1091 Total | 99.9674503 552 .181100453 Root MSE = .40168 ------------------------------------------------------------------------------ favwin | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- spread | .0193655 .0023386 8.28 0.000 .0147718 .0239593 _cons | .5769492 .0282345 20.43 0.000 .5214888 .6324097 ------------------------------------------------------------------------------ . predict yhat (option xb assumed; fitted values) . sum Variable | Obs Mean Std. Dev. Min Max -------------+----------------------------------------------------- favscr | 553 78.1302 13.52136 43 137 undscr | 553 68.58951 11.91347 36 105 spread | 553 9.61302 7.310553 1 39 favhome | 553 .6781193 .4676205 0 1 neutral | 553 .0632911 .2437063 0 1 fav25 | 553 .2640145 .4412061 0 1 und25 | 553 .0614828 .2404313 0 1 fregion | 553 2.779385 1.008196 0 4 uregion | 553 2.721519 .993743 1 4 scrdiff | 553 9.540687 13.32314 -33 52 sprdcvr | 553 .5153707 .5002162 0 1 favwin | 553 .7631103 .425559 0 1 yhat | 553 .7631103 .1415726 .5963148 1.332204 . **do a probit and report marginal effects . dprobit favwin spread Iteration 0: log likelihood = -302.74988 Iteration 1: log likelihood = -266.49244 Iteration 2: log likelihood = -263.62542 Iteration 3: log likelihood = -263.56223 Iteration 4: log likelihood = -263.56219 Probit estimates Number of obs = 553 LR chi2(1) = 78.38 Prob > chi2 = 0.0000 Log likelihood = -263.56219 Pseudo R2 = 0.1294 ------------------------------------------------------------------------------ favwin | dF/dx Std. Err. z P>|z| x-bar [ 95% C.I. ] ---------+-------------------------------------------------------------------- spread | .0250833 .0028961 7.59 0.000 9.61302 .019407 .03076 ---------+-------------------------------------------------------------------- obs. P | .7631103 pred. P | .8100975 (at x-bar) ------------------------------------------------------------------------------ z and P>|z| are the test of the underlying coefficient being 0 . predict yhatp (option p assumed; Pr(favwin)) . sum yhat* Variable | Obs Mean Std. Dev. Min Max -------------+----------------------------------------------------- yhat | 553 .7631103 .1415726 .5963148 1.332204 yhatp | 553 .7631952 .1506059 .5326251 .9998381 . graph yhat yhatp spread . log close log: C:\Documents and Settings\Patricia_Anderson\My Documents\ECON 20\I > nClass\nov4.log log type: text closed on: 4 Nov 2002, 12:16:41 -------------------------------------------------------------------------------