Clear and load dataset

clear
cd "E:\Econ 107\LAB1\data" 
use cps08.dta

Install outreg2 package

ssc outreg2, all

E 4.1

(a)

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:

(b)

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\)

(c)

Look at \(R^2=0.0290\), which means the age account for 2.9% of the variance in earnings.

E 5.1

(a)

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.

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.

(b)

\[\hat{\beta}\pm t_{1.96}\times standard~error\]

Plug all the numbers into this formula, we can get:

\[[0.526046,0.6839266]\]

(c)

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
------------------------------------------------------------------------------

(d)

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
------------------------------------------------------------------------------

(e)

Check the slope in two equations: