-----------------------------------------------------------------------------------

       log:  C:\AAA Miker Files\newer web pages\soc_meth_proj3\class11_2009.htm

  log type:  text

 opened on:   3 Mar 2009, 11:29:54

 

. set mem 200m

 

Current memory allocation

 

                    current                                 memory usage

    settable          value     description                 (1M = 1024k)

    --------------------------------------------------------------------

    set maxvar         5000     max. variables allowed           1.909M

    set memory          200M    max. data space                200.000M

    set matsize         400     max. RHS vars in models          1.254M

                                                            -----------

                                                               203.163M

 

. use "C:\AAA Miker Files\newer web pages\soc_meth_proj3\cps_mar_2000_new.dta", c

> lear

 

. tabulate vetlast

 

     Veteran's most recent |

         period of service |      Freq.     Percent        Cum.

---------------------------+-----------------------------------

                       NIU |     30,904       23.11       23.11

                No service |     91,149       68.17       91.28

              World War II |      2,428        1.82       93.10

                Korean War |      1,716        1.28       94.38

               Vietnam Era |      3,683        2.75       97.14

             Other service |      3,830        2.86      100.00

---------------------------+-----------------------------------

                     Total |    133,710      100.00

 

. tabulate vetstat

 

    Veteran |

     status |      Freq.     Percent        Cum.

------------+-----------------------------------

        NIU |     30,904       23.11       23.11

 No service |     91,149       68.17       91.28

        Yes |     11,657        8.72      100.00

------------+-----------------------------------

      Total |    133,710      100.00

 

. tabulate vetlast,nolab

 

  Veteran's |

most recent |

  period of |

    service |      Freq.     Percent        Cum.

------------+-----------------------------------

          0 |     30,904       23.11       23.11

          1 |     91,149       68.17       91.28

          4 |      2,428        1.82       93.10

          6 |      1,716        1.28       94.38

          8 |      3,683        2.75       97.14

          9 |      3,830        2.86      100.00

------------+-----------------------------------

      Total |    133,710      100.00

 

 

 

. gen byte vietnam=0

 

. replace vietnam=1 if vetlast==8

(3683 real changes made)

 

. tabulate vetlast vietnam

 

Veteran's most recent |        vietnam

    period of service |         0          1 |     Total

----------------------+----------------------+----------

                  NIU |    30,904          0 |    30,904

           No service |    91,149          0 |    91,149

         World War II |     2,428          0 |     2,428

           Korean War |     1,716          0 |     1,716

          Vietnam Era |         0      3,683 |     3,683

        Other service |     3,830          0 |     3,830

----------------------+----------------------+----------

                Total |   130,027      3,683 |   133,710

 

 

. table vietnam if age>24 & age<65 [aweight= perwt_rounded], contents (freq mean yrsed)

 

------------------------------------

  vietnam |       Freq.  mean(yrsed)

----------+-------------------------

        0 |      65,716      13.4641

        1 |       3,589     13.99024

------------------------------------

 

. *do model 5 from Hw 3

 

. regress incwage vietnam age age_sq male if age>24 & age<65 [aweight= perwt_rounded]

(sum of wgt is   1.4261e+08)

 

      Source |       SS       df       MS              Number of obs =   69305

-------------+------------------------------           F(  4, 69300) = 1600.10

       Model |  6.1652e+12     4  1.5413e+12           Prob > F      =  0.0000

    Residual |  6.6754e+13 69300   963258187           R-squared     =  0.0845

-------------+------------------------------           Adj R-squared =  0.0845

       Total |  7.2919e+13 69304  1.0522e+09           Root MSE      =   31036

 

------------------------------------------------------------------------------

     incwage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

-------------+----------------------------------------------------------------

     vietnam |   3656.148   563.5139     6.49   0.000     2551.662    4760.635

         age |   3177.754   92.44217    34.38   0.000     2996.567     3358.94

      age_sq |  -36.58361   1.049919   -34.84   0.000    -38.64145   -34.52577

        male |   16463.41   242.5037    67.89   0.000      15988.1    16938.71

       _cons |  -45660.57   1953.237   -23.38   0.000    -49488.91   -41832.23

------------------------------------------------------------------------------

 

. regress incwage vietnam age age_sq male yrsed if age>24 & age<65 [aweight= perwt_rounded]

(sum of wgt is   1.4261e+08)

 

      Source |       SS       df       MS              Number of obs =   69305

-------------+------------------------------           F(  5, 69299) = 3127.96

       Model |  1.3427e+13     5  2.6853e+12           Prob > F      =  0.0000

    Residual |  5.9492e+13 69299   858488914           R-squared     =  0.1841

-------------+------------------------------           Adj R-squared =  0.1841

       Total |  7.2919e+13 69304  1.0522e+09           Root MSE      =   29300

 

------------------------------------------------------------------------------

     incwage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

-------------+----------------------------------------------------------------

     vietnam |    1035.18   532.7493     1.94   0.052    -9.007979    2079.367

         age |   2848.096   87.34381    32.61   0.000     2676.902     3019.29

      age_sq |  -31.92762   .9924702   -32.17   0.000    -33.87286   -29.98238

        male |   16607.58   228.9415    72.54   0.000     16158.85     17056.3

       yrsed |   3540.933   38.50133    91.97   0.000      3465.47    3616.395

       _cons |   -88294.8   1901.336   -46.44   0.000    -92021.42   -84568.19

------------------------------------------------------------------------------

 

. *That's our model 5 from HW3

 

. predict HW3_M5

(option xb assumed; fitted values)

(30484 missing values generated)

 

. table yrsed vietnam if age==60 & sex==1, contents(mean  HW3_M5)

 

--------------------------------

based on  |       vietnam      

educrec   |         0          1

----------+---------------------

        0 | -15740.91          

      2.5 |  -6888.58          

      6.5 |  7275.151   8310.331

        9 |  16127.48   17162.66

       10 |  19668.42    20703.6

       11 |  23209.35          

       12 |  26750.28   27785.46

       14 |  33832.15   34867.33

       17 |  44454.95   45490.13

--------------------------------

 

. *Here we see predicted values of income from Model 5, Hw 3, and note the additivity of yrsed and vietnam vet, holding age and gender fixed.

 

. display 45490.13-44454.95

1035.18

 

. *We get the 1035 from every comparison across the rows.

 

. display 26750.28-23209.35

3540.93

 

. *And we get the 3540 for each additional year of education within each veteran

> status group.

 

. table yrsed vietnam if age==60 & sex==1, contents(mean  HW3_M5) row col

 

-------------------------------------------

based on  |             vietnam           

educrec   |         0          1      Total

----------+--------------------------------

        0 | -15740.91             -15740.91

      2.5 |  -6888.58              -6888.58

      6.5 |  7275.151   8310.331   7332.661

        9 |  16127.48   17162.66   16192.18

       10 |  19668.42    20703.6   19733.12

       11 |  23209.35              23209.35

       12 |  26750.28   27785.46   26843.92

       14 |  33832.15   34867.33   33985.89

       17 |  44454.95   45490.13   44680.93

          |

    Total |  29186.06   36585.72   30105.94

-------------------------------------------

 

. display 26843.92-23209.35

3634.57

 

. display 19733.12-16192.18

3540.94

 

. *Now two tables that won't show the same additivity

 

. table yrsed vietnam if age==60 & sex==1, contents(mean  incwage) row col

 

-------------------------------------------------

based on  |                vietnam               

educrec   |           0            1        Total

----------+--------------------------------------

        0 |           0                         0

      2.5 | 8937.777778               8937.777778

      6.5 | 13435.88235        10000        13245

        9 |     12351.2        30000     13454.25

       10 |       20600        29000        21125

       11 |       19900                     19900

       12 | 20145.87845        18000  19951.77889

       14 | 23095.10465  40435.06667  25670.34653

       17 | 49101.61261  49371.48387  49160.52817

          |

    Total |  26371.1691  37353.55882  27736.43876

-------------------------------------------------

 

. *In the real data, of course, the advantage of vietnam vets over non vets is not 1035 at every spot, it varies all over the place.

 

. table yrsed vietnam, contents(mean  HW3_M5) row col

 

-------------------------------------------

based on  |             vietnam           

educrec   |         0          1      Total

----------+--------------------------------

        0 | -31586.46             -31586.46

      2.5 | -21961.52  -2473.906  -21879.43

      6.5 | -12544.94    10837.9     -12422

        9 | -4113.708   21045.85  -3980.684

       10 |  254.0656   25661.23   508.4078

       11 |  5811.395   29119.02   6023.686

       12 |   14801.9   32279.37   15432.35

       14 |   22817.2   39229.54   23649.14

       17 |  36686.15   49159.22   37264.23

          |

    Total |  16944.91   38943.62    17729.8

-------------------------------------------

 

. *Here, with predicted values, you don't observe the additivity either because there are underlying differences, especially in gender, that we have not controlled for in this table....

 

. save "C:\AAA Miker Files\newer web pages\soc_meth_proj3\cps_mar_2000_new.dta",

> replace

file C:\AAA Miker Files\newer web pages\soc_meth_proj3\cps_mar_2000_new.dta saved

 

. exit, clear