E 7.1

Data: http://wps.aw.com/aw_stock_ie_3/178/45691/11696965.cw/

Clear and load dataset

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

(a)

\[AHE=\beta_0+\beta_1Age+\beta_2 Female+\beta_3 Bachelor\]

Codes

reg ahe age female bachelor, robust
outreg2 using LAB7.doc, replace

Results

Linear regression                               Number of obs     =      7,711
                                                F(3, 7707)        =     555.48
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1998
                                                Root MSE          =     9.0718

------------------------------------------------------------------------------
             |               Robust
         ahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .5852144   .0365302    16.02   0.000     .5136052    .6568236
      female |  -3.664026   .2076129   -17.65   0.000    -4.071003   -3.257048
    bachelor |   8.083001   .2126945    38.00   0.000     7.666062     8.49994
       _cons |  -.6356977   1.083075    -0.59   0.557    -2.758818    1.487423
------------------------------------------------------------------------------

\[AHE=-0.6356977+0.5852144Age-3.664026 Female+8.083001 Bachelor\]

Take differential:

\[dAHE=0.5852144dAge\]

Age increases from 25 to 26, which is one unit, ahe increases by 0.5852144.

Age increases from 33 to 34, which is one unit, ahe increases by 0.5852144.

(b)

\[log(AHE)=\beta_0+\beta_1Age+\beta_2 Female+\beta_3 Bachelor\]

Codes

gen logahe=ln(ahe)
reg logahe age female bachelor, robust
outreg2 using LAB7.doc

Results

Linear regression                               Number of obs     =      7,711
                                                F(3, 7707)        =     629.21
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2007
                                                Root MSE          =     .46938

------------------------------------------------------------------------------
             |               Robust
      logahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |    .027327   .0018604    14.69   0.000     .0236802    .0309738
      female |  -.1859238   .0108425   -17.15   0.000    -.2071781   -.1646696
    bachelor |   .4281274   .0108477    39.47   0.000      .406863    .4493919
       _cons |    1.87634   .0558599    33.59   0.000      1.76684    1.985841
------------------------------------------------------------------------------

\[log(AHE)=1.87634+0.027327Age-0.1859238 Female+0.4281274 Bachelor\]

Take differential:

\[\frac{dAHE}{AHE}=0.027327dAge\]

Age increases from 25 to 26, which is one unit, ahe increases by 2.7327%.

Age increases from 33 to 34, which is one unit, ahe increases by 2.7327%.

(c)

\[log(AHE)=\beta_0+\beta_1log(Age)+\beta_2 Female+\beta_3 Bachelor\]

Codes

gen logage=ln(age)
reg logahe logage female bachelor, robust
outreg2 using LAB7.doc

Results

Linear regression                               Number of obs     =      7,711
                                                F(3, 7707)        =     629.58
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2008
                                                Root MSE          =     .46935

------------------------------------------------------------------------------
             |               Robust
      logahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      logage |   .8039051   .0544678    14.76   0.000     .6971334    .9106768
      female |  -.1858896   .0108414   -17.15   0.000    -.2071417   -.1646374
    bachelor |   .4282541    .010847    39.48   0.000      .406991    .4495173
       _cons |  -.0345257   .1846056    -0.19   0.852    -.3964029    .3273515
------------------------------------------------------------------------------

\[log(AHE)=-0.0345257+0.8039051log(Age)-0.1858896 Female+0.4282541 Bachelor\]

Take differential:

\[\frac{dAHE}{AHE}=0.8039051\frac{dAge}{Age}\]

Age increases from 25 to 26, which is \((26-25)/25\times 100%=4%\), ahe increases by \(4\times 0.8039051=3.2156\).

Age increases from 33 to 34, which is \((34-33)/33\times 100%=3%\), ahe increases by \(3\times 0.8039051=2.4117\).

(d)

\[log(AHE)=\beta_0+\beta_1Age+\beta_2 Female+\beta_3 Bachelor+\beta_4Age^2\]

Codes

gen age2=age^2
reg logahe age female bachelor age2, robust
outreg2 using LAB7.doc

Results

Linear regression                               Number of obs     =      7,711
                                                F(4, 7706)        =     472.33
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2008
                                                Root MSE          =     .46937

------------------------------------------------------------------------------
             |               Robust
      logahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .0813725   .0433885     1.88   0.061    -.0036807    .1664257
      female |  -.1858687   .0108411   -17.14   0.000    -.2071203   -.1646172
    bachelor |    .428378   .0108492    39.48   0.000     .4071105    .4496455
        age2 |  -.0009148   .0007353    -1.24   0.213    -.0023561    .0005265
       _cons |    1.08543   .6353251     1.71   0.088      -.15998     2.33084
------------------------------------------------------------------------------

\[log(AHE)=1.08543+0.0813725Age-0.1858687 Female+0.428378 Bachelor-0.0009148Age^2\]

Take differential:

\[\frac{dAHE}{AHE}=(0.0813725-0.0018296Age^*)dAge\]

Let \(Age^*=\frac{Age_1+Age_0}{2}\)

Age increases from 25 to 26, which is one unit, ahe increases by \(0.0813725-0.0018296*25.5=3.47%\)

Age increases from 33 to 34, which is one unit, ahe increases by \(0.0813725-0.0018296*33.5=2%\).

( e )

Done

( f )

Codes

reg logahe age if female==0 & bachelor==0, robust
predict loglin

reg logahe logage if female==0 & bachelor==0, robust
predict loglog

reg logahe age age2 if female==0 & bachelor==0, robust
predict logquad

twoway lfitci loglin age \\Twoway linear prediction plots with CIs
twoway lfitci loglog age 
twoway lfitci logquad age