clear
cd "E:\Econ 107\LAB1\data"
use cps08.dta
outreg2 packagessc outreg2, all
reg ahe age
Results:
Source | SS df MS Number of obs = 7,711
-------------+---------------------------------- F(1, 7709) = 230.43
Model | 23005.7375 1 23005.7375 Prob > F = 0.0000
Residual | 769645.718 7,709 99.8372964 R-squared = 0.0290
-------------+---------------------------------- Adj R-squared = 0.0289
Total | 792651.456 7,710 102.80823 Root MSE = 9.9919
------------------------------------------------------------------------------
ahe | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age | .6049863 .0398542 15.18 0.000 .5268613 .6831113
_cons | 1.082275 1.184255 0.91 0.361 -1.239187 3.403737
------------------------------------------------------------------------------
use outreg2 to get outputs:
reg ahe age
outreg2 using lab1.doc, replace
Results:
table1.doc
dir : seeout
Based on the results, we have:
Slope is 1.082275
Intercept is 0.6049863
When age increases by 1 year, wage increases 0.6049863
Based on the results above, the estimated regression equation is:
\[\widehat{wage}=1.082275+0.6049863\times age\]
Plug age into this equation to get prediction:
Bob: \(wage=1.082275+0.6049863\times26=16.81192\)
Alexis: \(wage=1.082275+0.6049863\times30=19.23186\)
Look at \(R^2=0.0290\), which means the age account for 2.9% of the variance in earnings.
reg ahe age
Results:
Source | SS df MS Number of obs = 7,711
-------------+---------------------------------- F(1, 7709) = 230.43
Model | 23005.7375 1 23005.7375 Prob > F = 0.0000
Residual | 769645.718 7,709 99.8372964 R-squared = 0.0290
-------------+---------------------------------- Adj R-squared = 0.0289
Total | 792651.456 7,710 102.80823 Root MSE = 9.9919
------------------------------------------------------------------------------
ahe | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age | .6049863 .0398542 15.18 0.000 .5268613 .6831113
_cons | 1.082275 1.184255 0.91 0.361 -1.239187 3.403737
------------------------------------------------------------------------------
use outreg2 to get outputs:
reg ahe age
outreg2 using lab1.doc, replace
Results:
table1.doc
dir : seeout
Check the significance via p value.
\(\beta_0\) is significant at 1% level (p-value = 0.000<1%)
\(\beta_1\) is not significant at 10% 5% or 1% (p-value = 0.361 > 10%)
Notes: significant at 1% means p-value of a conefficient is less than the significant level 1%.
Relation between pvalue and t-stat:
The larger t-stat is, the smaller the pvalue is.
\[\hat{\beta}\pm t_{1.96}\times standard~error\]
Plug all the numbers into this formula, we can get:
\[[0.526046,0.6839266]\]
reg ahe age if bachelor == 0
Results:
Source | SS df MS Number of obs = 4,002
-------------+---------------------------------- F(1, 4000) = 48.56
Model | 2846.11544 1 2846.11544 Prob > F = 0.0000
Residual | 234434.405 4,000 58.6086014 R-squared = 0.0120
-------------+---------------------------------- Adj R-squared = 0.0117
Total | 237280.521 4,001 59.3053039 Root MSE = 7.6556
------------------------------------------------------------------------------
ahe | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age | .2978627 .0427436 6.97 0.000 .2140616 .3816639
_cons | 6.521941 1.269993 5.14 0.000 4.032048 9.011834
------------------------------------------------------------------------------
reg ahe age if bachelor == 1
Results:
Source | SS df MS Number of obs = 3,709
-------------+---------------------------------- F(1, 3707) = 233.02
Model | 26310.4073 1 26310.4073 Prob > F = 0.0000
Residual | 418558.237 3,707 112.910234 R-squared = 0.0591
-------------+---------------------------------- Adj R-squared = 0.0589
Total | 444868.644 3,708 119.975362 Root MSE = 10.626
------------------------------------------------------------------------------
ahe | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age | .924596 .0605696 15.27 0.000 .8058429 1.043349
_cons | -4.439163 1.799991 -2.47 0.014 -7.968234 -.9100928
------------------------------------------------------------------------------
Check the slope in two equations:
High school graduates (bachelor == 0): 0.2978627
College graduates (bachelor == 1): 0.924596