-------------
       log:  M:\undervisning\StataCourse\logSTATA3.smcl
  log type:  smcl
 opened on:  13 Oct 2006, 15:30:58

. regress  ahe age, robust

Linear regression                                      Number of obs =    5911
                                                       F(  1,  5909) =   95.21
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.0158
                                                       Root MSE      =  6.8502

-------------+----------------------------------------------------------------
             |               Robust
         ahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .3100626   .0317765     9.76   0.000      .247769    .3723562
       _cons |   4.745918   .9357954     5.07   0.000     2.911417    6.580419
-------------+----------------------------------------------------------------

.
.
. predict yhat
(option xb assumed; fitted values)

. list yhat if age==26

      +----------+
      |     yhat |
      +----------+
   6. | 12.80754 |
  11. | 12.80754 |
  28. | 12.80754 |
  37. | 12.80754 |
  48. | 12.80754 |
      +----------+
  55. | 12.80754 |
  57. | 12.80754 |
  64. | 12.80754 |
  74. | 12.80754 |
  81. | 12.80754 |
      +----------+
  96. | 12.80754 |
 100. | 12.80754 |
 106. | 12.80754 |
 108. | 12.80754 |
 119. | 12.80754 |
      +----------+
 134. | 12.80754 |
 142. | 12.80754 |
 163. | 12.80754 |
 191. | 12.80754 |
 192. | 12.80754 |
      +----------+
 197. | 12.80754 |
 213. | 12.80754 |
 221. | 12.80754 |
 234. | 12.80754 |
 235. | 12.80754 |
      +----------+
 251. | 12.80754 |
 262. | 12.80754 |
 292. | 12.80754 |
 301. | 12.80754 |
 316. | 12.80754 |
      +----------+
 321. | 12.80754 |
 333. | 12.80754 |
 334. | 12.80754 |
 345. | 12.80754 |
 350. | 12.80754 |
      +----------+
 359. | 12.80754 |
 372. | 12.80754 |
 387. | 12.80754 |
 388. | 12.80754 |
 448. | 12.80754 |
      +----------+
 452. | 12.80754 |
 453. | 12.80754 |
 468. | 12.80754 |
 484. | 12.80754 |
 525. | 12.80754 |
      +----------+
 527. | 12.80754 |
 536. | 12.80754 |
 537. | 12.80754 |
 562. | 12.80754 |
 567. | 12.80754 |
      +----------+
 576. | 12.80754 |
 622. | 12.80754 |
 654. | 12.80754 |
 660. | 12.80754 |
 661. | 12.80754 |
      +----------+
 666. | 12.80754 |
 671. | 12.80754 |
 675. | 12.80754 |
 720. | 12.80754 |
 730. | 12.80754 |
      +----------+
 734. | 12.80754 |
 739. | 12.80754 |
 775. | 12.80754 |
 785. | 12.80754 |
 786. | 12.80754 |
      +----------+
 801. | 12.80754 |
 802. | 12.80754 |
 803. | 12.80754 |
 824. | 12.80754 |
 829. | 12.80754 |
      +----------+
 858. | 12.80754 |
 867. | 12.80754 |
 870. | 12.80754 |
 905. | 12.80754 |
 909. | 12.80754 |
      +----------+
 917. | 12.80754 |
 921. | 12.80754 |
 923. | 12.80754 |
 935. | 12.80754 |
 945. | 12.80754 |
      +----------+
 947. | 12.80754 |
 954. | 12.80754 |
 963. | 12.80754 |
 979. | 12.80754 |
 980. | 12.80754 |
      +----------+
 981. | 12.80754 |
 994. | 12.80754 |
 995. | 12.80754 |
1000. | 12.80754 |
1020. | 12.80754 |
      +----------+
1022. | 12.80754 |
1025. | 12.80754 |
1048. | 12.80754 |
1051. | 12.80754 |
1057. | 12.80754 |
      +----------+
1074. | 12.80754 |
1088. | 12.80754 |
1090. | 12.80754 |
1091. | 12.80754 |
1108. | 12.80754 |
      +----------+
1112. | 12.80754 |
1124. | 12.80754 |
1126. | 12.80754 |
1129. | 12.80754 |
1142. | 12.80754 |
      +----------+
1160. | 12.80754 |
1166. | 12.80754 |
1168. | 12.80754 |
1190. | 12.80754 |
1203. | 12.80754 |
      +----------+
1245. | 12.80754 |
1259. | 12.80754 |
1276. | 12.80754 |
1284. | 12.80754 |
1286. | 12.80754 |
      +----------+
1307. | 12.80754 |
1314. | 12.80754 |
1358. | 12.80754 |
1365. | 12.80754 |
1368. | 12.80754 |
      +----------+
1373. | 12.80754 |
1379. | 12.80754 |
1410. | 12.80754 |
1415. | 12.80754 |
1417. | 12.80754 |
      +----------+
1471. | 12.80754 |
1478. | 12.80754 |
1502. | 12.80754 |
1505. | 12.80754 |
1509. | 12.80754 |
      +----------+
1519. | 12.80754 |
1536. | 12.80754 |
1544. | 12.80754 |
1552. | 12.80754 |
1555. | 12.80754 |
      +----------+
1564. | 12.80754 |
1570. | 12.80754 |
1607. | 12.80754 |
1610. | 12.80754 |
1612. | 12.80754 |
      +----------+
1613. | 12.80754 |
1644. | 12.80754 |
1645. | 12.80754 |
1646. | 12.80754 |
1660. | 12.80754 |
      +----------+
1681. | 12.80754 |
1687. | 12.80754 |
1700. | 12.80754 |
1706. | 12.80754 |
1719. | 12.80754 |
      +----------+
1735. | 12.80754 |
1746. | 12.80754 |
1766. | 12.80754 |
1771. | 12.80754 |
1773. | 12.80754 |
      +----------+
1776. | 12.80754 |
1779. | 12.80754 |
1801. | 12.80754 |
1802. | 12.80754 |
1806. | 12.80754 |
      +----------+
1812. | 12.80754 |
1819. | 12.80754 |
1823. | 12.80754 |
1824. | 12.80754 |
1831. | 12.80754 |
      +----------+
1854. | 12.80754 |
1856. | 12.80754 |
1859. | 12.80754 |
1866. | 12.80754 |
1870. | 12.80754 |
      +----------+
1881. | 12.80754 |
1886. | 12.80754 |
1889. | 12.80754 |
1892. | 12.80754 |
1898. | 12.80754 |
      +----------+
1954. | 12.80754 |
1971. | 12.80754 |
1984. | 12.80754 |
1985. | 12.80754 |
2013. | 12.80754 |
      +----------+
2038. | 12.80754 |
2042. | 12.80754 |
2062. | 12.80754 |
2065. | 12.80754 |
2068. | 12.80754 |
      +----------+
2071. | 12.80754 |
2081. | 12.80754 |
2089. | 12.80754 |
2093. | 12.80754 |
2120. | 12.80754 |
      +----------+
2129. | 12.80754 |
2161. | 12.80754 |
2172. | 12.80754 |
2185. | 12.80754 |
2209. | 12.80754 |
      +----------+
2211. | 12.80754 |
2226. | 12.80754 |
2230. | 12.80754 |
2260. | 12.80754 |
2263. | 12.80754 |
      +----------+
2267. | 12.80754 |
2268. | 12.80754 |
2281. | 12.80754 |
2287. | 12.80754 |
2289. | 12.80754 |
      +----------+
2296. | 12.80754 |
2300. | 12.80754 |
2304. | 12.80754 |
2311. | 12.80754 |
2313. | 12.80754 |
      +----------+
2314. | 12.80754 |
2316. | 12.80754 |
2321. | 12.80754 |
2342. | 12.80754 |
2365. | 12.80754 |
      +----------+
2380. | 12.80754 |
2391. | 12.80754 |
2418. | 12.80754 |
2423. | 12.80754 |
2425. | 12.80754 |
      +----------+
2434. | 12.80754 |
2440. | 12.80754 |
2443. | 12.80754 |
2457. | 12.80754 |
2459. | 12.80754 |
      +----------+
2461. | 12.80754 |
2468. | 12.80754 |
2476. | 12.80754 |
2492. | 12.80754 |
2503. | 12.80754 |
      +----------+
2511. | 12.80754 |
2518. | 12.80754 |
2525. | 12.80754 |
2531. | 12.80754 |
2532. | 12.80754 |
      +----------+
2534. | 12.80754 |
2583. | 12.80754 |
2587. | 12.80754 |
2620. | 12.80754 |
2622. | 12.80754 |
      +----------+
2623. | 12.80754 |
2709. | 12.80754 |
2718. | 12.80754 |
2731. | 12.80754 |
2733. | 12.80754 |
      +----------+
2737. | 12.80754 |
--Break--
r(1);

. list yhat if age==30

      +---------+
      |    yhat |
      +---------+
  14. | 14.0478 |
  18. | 14.0478 |
  25. | 14.0478 |
  26. | 14.0478 |
  27. | 14.0478 |
      +---------+
  39. | 14.0478 |
  52. | 14.0478 |
  62. | 14.0478 |
  63. | 14.0478 |
  69. | 14.0478 |
      +---------+
  70. | 14.0478 |
  73. | 14.0478 |
  83. | 14.0478 |
  84. | 14.0478 |
  85. | 14.0478 |
      +---------+
  86. | 14.0478 |
 101. | 14.0478 |
 113. | 14.0478 |
 116. | 14.0478 |
 117. | 14.0478 |
      +---------+
 128. | 14.0478 |
 130. | 14.0478 |
 144. | 14.0478 |
 145. | 14.0478 |
 154. | 14.0478 |
      +---------+
 171. | 14.0478 |
 173. | 14.0478 |
 180. | 14.0478 |
 207. | 14.0478 |
 208. | 14.0478 |
      +---------+
 220. | 14.0478 |
 241. | 14.0478 |
 261. | 14.0478 |
 267. | 14.0478 |
 272. | 14.0478 |
      +---------+
 284. | 14.0478 |
 285. | 14.0478 |
 288. | 14.0478 |
--Break--
r(1);

. regress  ahe age if female==1, robust

Linear regression                                      Number of obs =    2450
                                                       F(  1,  2448) =   23.66
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.0095
                                                       Root MSE      =  6.3136

-------------+----------------------------------------------------------------
             |               Robust
         ahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .2185752   .0449386     4.86   0.000     .1304537    .3066968
       _cons |   6.282881    1.32323     4.75   0.000     3.688114    8.877647
-------------+----------------------------------------------------------------

. predict yhatf
(option xb assumed; fitted values)

. regress  ahe age if female==0, robust

Linear regression                                      Number of obs =    3461
                                                       F(  1,  3459) =   70.26
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.0200
                                                       Root MSE      =  7.0861

-------------+----------------------------------------------------------------
             |               Robust
         ahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .3637947   .0434019     8.38   0.000     .2786988    .4488906
       _cons |    3.97824   1.280248     3.11   0.002     1.468122    6.488358
-------------+----------------------------------------------------------------

. predict yhatm
(option xb assumed; fitted values)

. gen agefem = age* female

. regress  ahe age agefem, robust

Linear regression                                      Number of obs =    5911
                                                       F(  2,  5908) =  110.58
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.0369
                                                       Root MSE      =  6.7769

-------------+----------------------------------------------------------------
             |               Robust
         ahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .3312045   .0315677    10.49   0.000     .2693202    .3930888
      agefem |  -.0682871   .0059499   -11.48   0.000    -.0799512    -.056623
       _cons |   4.956661   .9263627     5.35   0.000     3.140651     6.77267
-------------+----------------------------------------------------------------

. list yhatf if age==30

      +----------+
      |    yhatf |
      +----------+
  14. | 12.84014 |
  18. | 12.84014 |
  25. | 12.84014 |
  26. | 12.84014 |
  27. | 12.84014 |
      +----------+
  39. | 12.84014 |
  52. | 12.84014 |
  62. | 12.84014 |
  63. | 12.84014 |
  69. | 12.84014 |
      +----------+
  70. | 12.84014 |
  73. | 12.84014 |
  83. | 12.84014 |
  84. | 12.84014 |
  85. | 12.84014 |
      +----------+
  86. | 12.84014 |
 101. | 12.84014 |
 113. | 12.84014 |
 116. | 12.84014 |
 117. | 12.84014 |
      +----------+
 128. | 12.84014 |
 130. | 12.84014 |
 144. | 12.84014 |
 145. | 12.84014 |
 154. | 12.84014 |
      +----------+
 171. | 12.84014 |
 173. | 12.84014 |
 180. | 12.84014 |
 207. | 12.84014 |
 208. | 12.84014 |
      +----------+
 220. | 12.84014 |
 241. | 12.84014 |
 261. | 12.84014 |
 267. | 12.84014 |
 272. | 12.84014 |
      +----------+
 284. | 12.84014 |
 285. | 12.84014 |
 288. | 12.84014 |
--Break--
r(1);

. list yhatm if age==26

      +---------+
      |   yhatm |
      +---------+
   6. | 13.4369 |
  11. | 13.4369 |
  28. | 13.4369 |
  37. | 13.4369 |
  48. | 13.4369 |
      +---------+
  55. | 13.4369 |
  57. | 13.4369 |
  64. | 13.4369 |
  74. | 13.4369 |
  81. | 13.4369 |
      +---------+
  96. | 13.4369 |
 100. | 13.4369 |
 106. | 13.4369 |
 108. | 13.4369 |
 119. | 13.4369 |
      +---------+
 134. | 13.4369 |
 142. | 13.4369 |
 163. | 13.4369 |
 191. | 13.4369 |
 192. | 13.4369 |
      +---------+
 197. | 13.4369 |
 213. | 13.4369 |
 221. | 13.4369 |
 234. | 13.4369 |
 235. | 13.4369 |
      +---------+
 251. | 13.4369 |
 262. | 13.4369 |
 292. | 13.4369 |
 301. | 13.4369 |
 316. | 13.4369 |
      +---------+
 321. | 13.4369 |
 333. | 13.4369 |
 334. | 13.4369 |
 345. | 13.4369 |
 350. | 13.4369 |
      +---------+
 359. | 13.4369 |
 372. | 13.4369 |
 387. | 13.4369 |
--Break--
r(1);

. regress  ahe age female bachelor, robust

Linear regression                                      Number of obs =    5911
                                                       F(  3,  5907) =  397.40
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.1823
                                                       Root MSE      =  6.2451

-------------+----------------------------------------------------------------
             |               Robust
         ahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .3144165   .0290644    10.82   0.000     .2574397    .3713933
      female |  -2.493215   .1616115   -15.43   0.000    -2.810033   -2.176398
    bachelor |   5.335746   .1709797    31.21   0.000     5.000564    5.670929
       _cons |   3.300273   .8667427     3.81   0.000      1.60114    4.999405
-------------+----------------------------------------------------------------

. predict yhat2
(option xb assumed; fitted values)

. di  3.300273 +  .3144165 *26
11.475102

. list yhat2 if age==26 & female==0 & bachelor==0

      +---------+
      |   yhat2 |
      +---------+
   6. | 11.4751 |
  57. | 11.4751 |
  96. | 11.4751 |
 100. | 11.4751 |
 119. | 11.4751 |
      +---------+
 142. | 11.4751 |
 163. | 11.4751 |
 192. | 11.4751 |
 213. | 11.4751 |
 301. | 11.4751 |
      +---------+
 333. | 11.4751 |
 334. | 11.4751 |
 388. | 11.4751 |
 448. | 11.4751 |
 452. | 11.4751 |
      +---------+
 484. | 11.4751 |
 536. | 11.4751 |
 567. | 11.4751 |
 675. | 11.4751 |
 730. | 11.4751 |
      +---------+
 739. | 11.4751 |
 785. | 11.4751 |
 786. | 11.4751 |
 829. | 11.4751 |
 858. | 11.4751 |
      +---------+
 870. | 11.4751 |
 905. | 11.4751 |
 945. | 11.4751 |
 947. | 11.4751 |
 954. | 11.4751 |
      +---------+
 979. | 11.4751 |
1020. | 11.4751 |
1022. | 11.4751 |
1051. | 11.4751 |
1057. | 11.4751 |
      +---------+
1112. | 11.4751 |
1124. | 11.4751 |
1129. | 11.4751 |
--Break--
r(1);

. di  3.300273 +  .3144165 *30 -2.493215 + 5.335746
15.575299

. list yhat2 if age==30 & female==1 & bachelor==1

      +---------+
      |   yhat2 |
      +---------+
  14. | 15.5753 |
  27. | 15.5753 |
  63. | 15.5753 |
  86. | 15.5753 |
 130. | 15.5753 |
      +---------+
 144. | 15.5753 |
 261. | 15.5753 |
 284. | 15.5753 |
 288. | 15.5753 |
 304. | 15.5753 |
      +---------+
 309. | 15.5753 |
 314. | 15.5753 |
 410. | 15.5753 |
 420. | 15.5753 |
 433. | 15.5753 |
      +---------+
 441. | 15.5753 |
 447. | 15.5753 |
 454. | 15.5753 |
 494. | 15.5753 |
 586. | 15.5753 |
      +---------+
 611. | 15.5753 |
 630. | 15.5753 |
 634. | 15.5753 |
 668. | 15.5753 |
 906. | 15.5753 |
      +---------+
 986. | 15.5753 |
1003. | 15.5753 |
1102. | 15.5753 |
1107. | 15.5753 |
1121. | 15.5753 |
      +---------+
1159. | 15.5753 |
1311. | 15.5753 |
1394. | 15.5753 |
1407. | 15.5753 |
1412. | 15.5753 |
      +---------+
1546. | 15.5753 |
1589. | 15.5753 |
1628. | 15.5753 |
--Break--
r(1);

. test  female bachelor

 ( 1)  female = 0
 ( 2)  bachelor = 0

       F(  2,  5907) =  562.07
            Prob > F =    0.0000

. regress age  female bachelor

      Source |       SS       df       MS              Number of obs =    5911
-------------+------------------------------           F(  2,  5908) =    1.86
       Model |  29.2788359     2  14.6394179           Prob > F      =  0.1550
    Residual |  46383.6117  5908   7.8509837           R-squared     =  0.0006
-------------+------------------------------           Adj R-squared =  0.0003
       Total |  46412.8905  5910  7.85328097           Root MSE      =   2.802

-------------+----------------------------------------------------------------
         age |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      female |   -.116547   .0742852    -1.57   0.117    -.2621731    .0290791
    bachelor |  -.0721724   .0737167    -0.98   0.328    -.2166842    .0723394
       _cons |   29.79097   .0561134   530.91   0.000     29.68096    29.90097
-------------+----------------------------------------------------------------

. gen lnahe = ln(ahe)

. regress lnahe age  female bachelor, robust

Linear regression                                      Number of obs =    5911
                                                       F(  3,  5907) =  438.49
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.1828
                                                       Root MSE      =  .44574

-------------+----------------------------------------------------------------
             |               Robust
       lnahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .0214183   .0020818    10.29   0.000     .0173372    .0254993
      female |  -.1800279   .0116842   -15.41   0.000    -.2029332   -.1571227
    bachelor |   .3827709   .0117285    32.64   0.000     .3597787    .4057631
       _cons |   1.788448   .0624729    28.63   0.000     1.665979    1.910918
-------------+----------------------------------------------------------------

. predict fit1
(option xb assumed; fitted values)

. gen lnage = ln(age)

. regress lnahe lnage  female bachelor, robust

Linear regression                                      Number of obs =    5911
                                                       F(  3,  5907) =  439.58
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.1831
                                                       Root MSE      =  .44565

-------------+----------------------------------------------------------------
             |               Robust
       lnahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       lnage |   .6369272   .0611597    10.41   0.000     .5170319    .7568225
      female |  -.1798992   .0116819   -15.40   0.000    -.2027999   -.1569984
    bachelor |   .3825962   .0117255    32.63   0.000     .3596099    .4055824
       _cons |   .2675497   .2073084     1.29   0.197    -.1388505    .6739499
-------------+----------------------------------------------------------------

. predict fit2
(option xb assumed; fitted values)

. di ln(26)-ln(25)
.03922071

. di .6369272  * .03922071
.02498074

. di ln(33)-ln(34)
-.02985296

. di .6369272  * .02985296
.01901416

. gen age2 = age^2

. regress lnahe age age2 female bachelor, robust

Linear regression                                      Number of obs =    5911
                                                       F(  4,  5906) =  332.50
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.1839
                                                       Root MSE      =  .44546

-------------+----------------------------------------------------------------
             |               Robust
       lnahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .1590073   .0473075     3.36   0.001     .0662672    .2517473
        age2 |  -.0023236   .0007989    -2.91   0.004    -.0038896   -.0007575
      female |  -.1793598   .0116807   -15.36   0.000    -.2022583   -.1564612
    bachelor |   .3815594   .0117354    32.51   0.000     .3585539     .404565
       _cons |  -.2298404   .6955189    -0.33   0.741    -1.593312    1.133631
-------------+----------------------------------------------------------------

. predict fit3
(option xb assumed; fitted values)

. di (.1590073 *26  -.0023236 *26^2) - (.1590073 *25  -.0023236 *25^2)
.0405037

. di (.1590073 *34  -.0023236 *34^2) - (.1590073 *33  -.0023236 *33^2)
.0033261

. di (.1590073 *35  -.0023236 *35^2) - (.1590073 *34  -.0023236 *34^2)
-.0013211

. line  fit1 fit2 fit3 age if female ==0 & bachelor ==1

. browse

. line  fit1 fit2 fit3 age if female ==1 & bachelor ==1

. gen fembach = female*bachelor

. regress lnahe age age2 female bachelor fembach, robust

Linear regression                                      Number of obs =    5911
                                                       F(  5,  5905) =  272.98
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.1857
                                                       Root MSE      =  .44502

-------------+----------------------------------------------------------------
             |               Robust
       lnahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .1615669   .0472137     3.42   0.001     .0690107     .254123
        age2 |  -.0023639   .0007973    -2.96   0.003    -.0039269   -.0008009
      female |  -.2180115   .0156859   -13.90   0.000    -.2487616   -.1872613
    bachelor |   .3455236   .0158466    21.80   0.000     .3144585    .3765887
     fembach |   .0849926   .0234672     3.62   0.000     .0389883     .130997
       _cons |  -.2554836   .6941003    -0.37   0.713    -1.616174    1.105207
-------------+----------------------------------------------------------------

. predict yhat3
(option xb assumed; fitted values)

. list yhat3 if age==30 & female==1 & bachelor==1

      +---------+
      |   yhat3 |
      +---------+
3904. | 2.67652 |
3905. | 2.67652 |
3906. | 2.67652 |
3907. | 2.67652 |
3908. | 2.67652 |
      +---------+
3909. | 2.67652 |
3910. | 2.67652 |
3911. | 2.67652 |
3912. | 2.67652 |
3913. | 2.67652 |
      +---------+
3914. | 2.67652 |
3915. | 2.67652 |
3916. | 2.67652 |
3917. | 2.67652 |
3918. | 2.67652 |
      +---------+
3919. | 2.67652 |
3920. | 2.67652 |
3921. | 2.67652 |
3922. | 2.67652 |
3923. | 2.67652 |
      +---------+
3924. | 2.67652 |
3925. | 2.67652 |
3926. | 2.67652 |
3927. | 2.67652 |
3928. | 2.67652 |
      +---------+
3929. | 2.67652 |
3930. | 2.67652 |
3931. | 2.67652 |
3932. | 2.67652 |
3933. | 2.67652 |
      +---------+
3934. | 2.67652 |
3935. | 2.67652 |
3936. | 2.67652 |
3937. | 2.67652 |
3938. | 2.67652 |
      +---------+
3939. | 2.67652 |
3940. | 2.67652 |
3941. | 2.67652 |
--Break--
r(1);

. list yhat3 if age==30 & female==1 & bachelor==0

      +----------+
      |    yhat3 |
      +----------+
 581. | 2.246004 |
 582. | 2.246004 |
 583. | 2.246004 |
 584. | 2.246004 |
 585. | 2.246004 |
      +----------+
 586. | 2.246004 |
 587. | 2.246004 |
 588. | 2.246004 |
 589. | 2.246004 |
 590. | 2.246004 |
      +----------+
 591. | 2.246004 |
 592. | 2.246004 |
 593. | 2.246004 |
 594. | 2.246004 |
 595. | 2.246004 |
      +----------+
 596. | 2.246004 |
 597. | 2.246004 |
 598. | 2.246004 |
 599. | 2.246004 |
 600. | 2.246004 |
      +----------+
 601. | 2.246004 |
 602. | 2.246004 |
 603. | 2.246004 |
 604. | 2.246004 |
 605. | 2.246004 |
      +----------+
 606. | 2.246004 |
 607. | 2.246004 |
 608. | 2.246004 |
 609. | 2.246004 |
 610. | 2.246004 |
      +----------+
 611. | 2.246004 |
 612. | 2.246004 |
 613. | 2.246004 |
 614. | 2.246004 |
 615. | 2.246004 |
      +----------+
 616. | 2.246004 |
 617. | 2.246004 |
 618. | 2.246004 |
--Break--
r(1);

. di   2.67652 - 2.246004
.430516

. list yhat3 if age==30 & female==0 & bachelor==1

      +----------+
      |    yhat3 |
      +----------+
5169. | 2.809539 |
5170. | 2.809539 |
5171. | 2.809539 |
5172. | 2.809539 |
5173. | 2.809539 |
      +----------+
5174. | 2.809539 |
5175. | 2.809539 |
5176. | 2.809539 |
5177. | 2.809539 |
5178. | 2.809539 |
      +----------+
5179. | 2.809539 |
5180. | 2.809539 |
5181. | 2.809539 |
5182. | 2.809539 |
5183. | 2.809539 |
      +----------+
5184. | 2.809539 |
5185. | 2.809539 |
5186. | 2.809539 |
5187. | 2.809539 |
5188. | 2.809539 |
      +----------+
5189. | 2.809539 |
5190. | 2.809539 |
5191. | 2.809539 |
5192. | 2.809539 |
5193. | 2.809539 |
      +----------+
5194. | 2.809539 |
5195. | 2.809539 |
5196. | 2.809539 |
5197. | 2.809539 |
5198. | 2.809539 |
      +----------+
5199. | 2.809539 |
5200. | 2.809539 |
5201. | 2.809539 |
5202. | 2.809539 |
5203. | 2.809539 |
      +----------+
5204. | 2.809539 |
5205. | 2.809539 |
5206. | 2.809539 |
--Break--
r(1);

. list yhat3 if age==30 & female==0 & bachelor==0

      +----------+
      |    yhat3 |
      +----------+
2191. | 2.464015 |
2192. | 2.464015 |
2193. | 2.464015 |
2194. | 2.464015 |
2195. | 2.464015 |
      +----------+
2196. | 2.464015 |
2197. | 2.464015 |
2198. | 2.464015 |
2199. | 2.464015 |
2200. | 2.464015 |
      +----------+
2201. | 2.464015 |
2202. | 2.464015 |
2203. | 2.464015 |
2204. | 2.464015 |
2205. | 2.464015 |
      +----------+
2206. | 2.464015 |
2207. | 2.464015 |
2208. | 2.464015 |
2209. | 2.464015 |
2210. | 2.464015 |
      +----------+
2211. | 2.464015 |
2212. | 2.464015 |
2213. | 2.464015 |
2214. | 2.464015 |
2215. | 2.464015 |
      +----------+
2216. | 2.464015 |
2217. | 2.464015 |
2218. | 2.464015 |
2219. | 2.464015 |
2220. | 2.464015 |
      +----------+
2221. | 2.464015 |
2222. | 2.464015 |
2223. | 2.464015 |
2224. | 2.464015 |
2225. | 2.464015 |
      +----------+
2226. | 2.464015 |
2227. | 2.464015 |
2228. | 2.464015 |
--Break--
r(1);

. di    2.809539  -  2.464015
.345524

. di   .430516  - .345524
.084992

. gen age2fem = age2*female

. regress lnahe age age2 female bachelor agefem age2fem, robust

Linear regression                                      Number of obs =    5911
                                                       F(  6,  5904) =  221.77
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.1841
                                                       Root MSE      =   .4455

-------------+----------------------------------------------------------------
             |               Robust
       lnahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .1443945   .0641739     2.25   0.024     .0185901    .2701989
        age2 |  -.0020483   .0010826    -1.89   0.059    -.0041706    .0000741
      female |  -.6467945   1.391798    -0.46   0.642    -3.375227    2.081638
    bachelor |   .3813582   .0117436    32.47   0.000     .3583364    .4043799
      agefem |    .035988   .0946792     0.38   0.704    -.1496178    .2215939
     age2fem |  -.0006758   .0015991    -0.42   0.673    -.0038106     .002459
       _cons |  -.0408433   .9444908    -0.04   0.966    -1.892391    1.810704
-------------+----------------------------------------------------------------

. regress lnahe age age2 female bachelor agefem age2fem fembach, robust

Linear regression                                      Number of obs =    5911
                                                       F(  7,  5903) =  195.14
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.1858
                                                       Root MSE      =  .44506

-------------+----------------------------------------------------------------
             |               Robust
       lnahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .1514811   .0641236     2.36   0.018     .0257755    .2771868
        age2 |  -.0021671    .001082    -2.00   0.045    -.0042882   -.0000461
      female |  -.5310615   1.389779    -0.38   0.702    -3.255536    2.193413
    bachelor |   .3455968   .0158572    21.79   0.000      .314511    .3766826
      agefem |   .0251814   .0945838     0.27   0.790    -.1602374    .2106002
     age2fem |  -.0004883   .0015976    -0.31   0.760    -.0036202    .0026436
     fembach |   .0843481   .0235129     3.59   0.000     .0382541    .1304421
       _cons |  -.1311653   .9434502    -0.14   0.889    -1.980673    1.718342
-------------+----------------------------------------------------------------

. test  agefem age2fem

 ( 1)  agefem = 0
 ( 2)  age2fem = 0

       F(  2,  5903) =    0.44
            Prob > F =    0.6435

. gen agebach = age*bachelor

. gen age2bach = age2*bachelor

. lnahe age age2 female bachelor agebach age2bach , robust
unrecognized command:  lnahe
r(199);

. test  agebach age2bach
agebach not found
r(111);

. regress lnahe age age2 female bachelor agebach age2bach , robust

Linear regression                                      Number of obs =    5911
                                                       F(  6,  5904) =  221.78
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.1840
                                                       Root MSE      =  .44552

-------------+----------------------------------------------------------------
             |               Robust
       lnahe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .1561725   .0629686     2.48   0.013      .032731     .279614
        age2 |  -.0022969   .0010611    -2.16   0.030     -.004377   -.0002167
      female |  -.1791536   .0116889   -15.33   0.000    -.2020681    -.156239
    bachelor |   .2578338   1.402126     0.18   0.854    -2.490846    3.006513
     agebach |   .0054157   .0954193     0.06   0.955     -.181641    .1924724
    age2bach |  -.0000417   .0016125    -0.03   0.979    -.0032028    .0031193
       _cons |  -.1694507    .927531    -0.18   0.855    -1.987751    1.648849
-------------+----------------------------------------------------------------

. test  agebach age2bach

 ( 1)  agebach = 0
 ( 2)  age2bach = 0

       F(  2,  5904) =    0.24
            Prob > F =    0.7832

. log close
       log:  M:\undervisning\StataCourse\logSTATA3.smcl
  log type:  smcl
 closed on:  13 Oct 2006, 15:44:09
-------------