Chapter 3 - Examples
-------------------------------------------------------------------------------------
name: SN
log: ~Wooldridge\intro-econx\iexample3.smcl
log type: smcl
opened on: 5 Jan 2019, 23:46:37
. **********************************************
. * Solomon Negash - Replicating Examples
. * Wooldridge, Jeffery (2016). Introductory Econometrics: A Modern Approach. 6th ed.
. * STATA Program, version 15.1.
. * Chapter 3 - Multiple Regression Analysis
. * Computer Exercises (Examples)
. ******************** SETUP *********************
. *example3.1 Determinants of College GPA
. u gpa1.dta, clear
. eststo: reg colG hsGP ACT
Source | SS df MS Number of obs = 141
-------------+---------------------------------- F(2, 138) = 14.78
Model | 3.42365506 2 1.71182753 Prob > F = 0.0000
Residual | 15.9824444 138 .115814814 R-squared = 0.1764
-------------+---------------------------------- Adj R-squared = 0.1645
Total | 19.4060994 140 .138614996 Root MSE = .34032
------------------------------------------------------------------------------
colGPA | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
hsGPA | .4534559 .0958129 4.73 0.000 .2640047 .6429071
ACT | .009426 .0107772 0.87 0.383 -.0118838 .0307358
_cons | 1.286328 .3408221 3.77 0.000 .612419 1.960237
------------------------------------------------------------------------------
(est3 stored)
. eststo: reg colG ACT
Source | SS df MS Number of obs = 141
-------------+---------------------------------- F(1, 139) = 6.21
Model | .829558811 1 .829558811 Prob > F = 0.0139
Residual | 18.5765406 139 .133644177 R-squared = 0.0427
-------------+---------------------------------- Adj R-squared = 0.0359
Total | 19.4060994 140 .138614996 Root MSE = .36557
------------------------------------------------------------------------------
colGPA | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ACT | .027064 .0108628 2.49 0.014 .0055862 .0485417
_cons | 2.402979 .2642027 9.10 0.000 1.880604 2.925355
------------------------------------------------------------------------------
(est4 stored)
. esttab, se
------------------------------------------------
(1) (2)
colGPA colGPA
------------------------------------------------
hsGPA 0.453***
(0.0958)
ACT 0.00943 0.0271*
(0.0108) (0.0109)
_cons 1.286*** 2.403***
(0.341) (0.264)
--------------------------------------------------
N 141 141
--------------------------------------------------
Standard errors in parentheses
* p<0.05, ** p<0.01, *** p<0.001
. est clear
. *example3.2. Wage equation
. u wage1.dta, clear
. reg lwage educ exper tenure
Source | SS df MS Number of obs = 526
-------------+---------------------------------- F(3, 522) = 80.39
Model | 46.8741776 3 15.6247259 Prob > F = 0.0000
Residual | 101.455574 522 .194359337 R-squared = 0.3160
-------------+---------------------------------- Adj R-squared = 0.3121
Total | 148.329751 525 .28253286 Root MSE = .44086
------------------------------------------------------------------------------
lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ | .092029 .0073299 12.56 0.000 .0776292 .1064288
exper | .0041211 .0017233 2.39 0.017 .0007357 .0075065
tenure | .0220672 .0030936 7.13 0.000 .0159897 .0281448
_cons | .2843595 .1041904 2.73 0.007 .0796756 .4890435
------------------------------------------------------------------------------
. *example3.3. Participation in 401(k) pension plans
. u 401k.dta, clear
. reg prate mrate age
Source | SS df MS Number of obs = 1,534
-------------+---------------------------------- F(2, 1531) = 77.79
Model | 39517.1118 2 19758.5559 Prob > F = 0.0000
Residual | 388868.428 1,531 253.99636 R-squared = 0.0922
-------------+---------------------------------- Adj R-squared = 0.0911
Total | 428385.539 1,533 279.442622 Root MSE = 15.937
------------------------------------------------------------------------------
prate | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mrate | 5.521289 .5258844 10.50 0.000 4.489759 6.552819
age | .2431466 .0446999 5.44 0.000 .1554671 .330826
_cons | 80.11905 .7790208 102.85 0.000 78.59099 81.64711
------------------------------------------------------------------------------
. *example3.4. Determinants of College GPA, R-squared. See example3.1.
. u gpa1.dta, clear
. reg colG hsGP ACT
Source | SS df MS Number of obs = 141
-------------+---------------------------------- F(2, 138) = 14.78
Model | 3.42365506 2 1.71182753 Prob > F = 0.0000
Residual | 15.9824444 138 .115814814 R-squared = 0.1764
-------------+---------------------------------- Adj R-squared = 0.1645
Total | 19.4060994 140 .138614996 Root MSE = .34032
------------------------------------------------------------------------------
colGPA | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
hsGPA | .4534559 .0958129 4.73 0.000 .2640047 .6429071
ACT | .009426 .0107772 0.87 0.383 -.0118838 .0307358
_cons | 1.286328 .3408221 3.77 0.000 .612419 1.960237
------------------------------------------------------------------------------
. *example3.5 Arrest records
. u crime1.dta, clear
. eststo: reg narr86 pcnv ptime86 qemp86
Source | SS df MS Number of obs = 2,725
-------------+---------------------------------- F(3, 2721) = 39.10
Model | 83.0741941 3 27.691398 Prob > F = 0.0000
Residual | 1927.27296 2,721 .708295833 R-squared = 0.0413
-------------+---------------------------------- Adj R-squared = 0.0403
Total | 2010.34716 2,724 .738012906 Root MSE = .8416
------------------------------------------------------------------------------
narr86 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
pcnv | -.1499274 .0408653 -3.67 0.000 -.2300576 -.0697973
ptime86 | -.0344199 .008591 -4.01 0.000 -.0512655 -.0175744
qemp86 | -.104113 .0103877 -10.02 0.000 -.1244816 -.0837445
_cons | .7117715 .0330066 21.56 0.000 .647051 .776492
------------------------------------------------------------------------------
(est1 stored)
. eststo: reg narr86 pcnv avgsen ptime86 qemp86
Source | SS df MS Number of obs = 2,725
-------------+---------------------------------- F(4, 2720) = 29.96
Model | 84.8242895 4 21.2060724 Prob > F = 0.0000
Residual | 1925.52287 2,720 .707912819 R-squared = 0.0422
-------------+---------------------------------- Adj R-squared = 0.0408
Total | 2010.34716 2,724 .738012906 Root MSE = .84138
------------------------------------------------------------------------------
narr86 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
pcnv | -.1508319 .0408583 -3.69 0.000 -.2309484 -.0707154
avgsen | .0074431 .0047338 1.57 0.116 -.0018392 .0167254
ptime86 | -.0373908 .0087941 -4.25 0.000 -.0546345 -.0201471
qemp86 | -.103341 .0103965 -9.94 0.000 -.1237268 -.0829552
_cons | .7067565 .0331515 21.32 0.000 .6417519 .771761
------------------------------------------------------------------------------
(est2 stored)
. esttab, se r2
--------------------------------------------
(1) (2)
narr86 narr86
--------------------------------------------
pcnv -0.150*** -0.151***
(0.0409) (0.0409)
ptime86 -0.0344*** -0.0374***
(0.00859) (0.00879)
qemp86 -0.104*** -0.103***
(0.0104) (0.0104)
avgsen 0.00744
(0.00473)
_cons 0.712*** 0.707***
(0.0330) (0.0332)
--------------------------------------------
N 2725 2725
R-sq 0.041 0.042
--------------------------------------------
Standard errors in parentheses
* p<0.05, ** p<0.01, *** p<0.001
. est clear
. *example3.6 Wage equation
. u wage1.dta, clear
. reg lwage educ
Source | SS df MS Number of obs = 526
-------------+---------------------------------- F(1, 524) = 119.58
Model | 27.5606288 1 27.5606288 Prob > F = 0.0000
Residual | 120.769123 524 .230475425 R-squared = 0.1858
-------------+---------------------------------- Adj R-squared = 0.1843
Total | 148.329751 525 .28253286 Root MSE = .48008
------------------------------------------------------------------------------
lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ | .0827444 .0075667 10.94 0.000 .0678796 .0976091
_cons | .5837727 .0973358 6.00 0.000 .3925563 .7749891
------------------------------------------------------------------------------
. log close
name: SN
log: ~Wooldridge\intro-econx\iexample3.smcl
log type: smcl
closed on: 5 Jan 2019, 23:46:37
-------------------------------------------------------------------------------------