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

      name:  <unnamed>

       log:  C:\Users\Michael\Documents\newer web pages\soc_meth_proj3\fall_2016_logs\class8.log

  log type:  text

 opened on:  19 Oct 2016, 10:17:53

 

. use "C:\Users\Michael\Documents\current class files\intro soc methods\cps_mar_2000_new with additional vars.dta",

>  clear

 

 

. regress incwage age age_sq yrsed married male i.race if age >=25 & age <=64 [aweight= perwt_rounded]

(sum of wgt is   1.4261e+08)

 

      Source |       SS       df       MS              Number of obs =   69305

-------------+------------------------------           F(  8, 69296) = 2008.75

       Model |  1.3727e+13     8  1.7159e+12           Prob > F      =  0.0000

    Residual |  5.9192e+13 69296   854192824           R-squared     =  0.1882

-------------+------------------------------           Adj R-squared =  0.1882

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

 

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

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

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

                          age |   2737.602   87.40829    31.32   0.000     2566.282    2908.922

                       age_sq |  -30.90895   .9930601   -31.12   0.000    -32.85534   -28.96255

                        yrsed |   3491.357   38.51498    90.65   0.000     3415.867    3566.846

                      married |   3182.541   240.5636    13.23   0.000     2711.037    3654.046

                         male |   16597.64   222.2257    74.69   0.000     16162.08     17033.2

                              |

                         race |

                 Black/Negro  |  -3530.491   347.2994   -10.17   0.000    -4211.198   -2849.785

American Indian/Aleut/Eskimo  |  -5822.139   1181.959    -4.93   0.000    -8138.777   -3505.502

   Asian or Pacific Islander  |  -1348.464   561.7893    -2.40   0.016     -2449.57    -247.358

                              |

                        _cons |  -86376.09   1890.877   -45.68   0.000     -90082.2   -82669.97

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

 

. matrix VC=e(V)

 

* e(V) is a matrix that stata produces after every regression, you just have to call it up and rename it.

 

. matrix list VC

 

symmetric VC[10,10]

                                                                             100b.        200.        300.

                  age      age_sq       yrsed     married        male        race        race        race

      age   7640.2094

   age_sq  -86.157016   .98616843

    yrsed  -134.03946   1.8818845   1483.4035

  married  -2133.9449   20.533356  -423.14483   57870.827

     male  -77.007314   1.2186348  -34.320357  -502.37335   49384.263

100b.race           0           0           0           0           0           0

 200.race  -483.59055   6.6633063   634.97375   13857.211   2129.1696           0   120616.88

 300.race   272.13585  -1.7595027   1485.8529   4869.0456   570.44689           0   16997.268   1397026.8

 650.race   563.21372  -4.0685094  -934.51661  -1567.6385   1318.4951           0   14405.105   14028.879

    _cons  -156200.51   1730.2182  -17685.649   17681.931  -22737.229           0  -26294.339  -46835.248

 

                  650.           

                 race       _cons

 650.race    315607.2

    _cons  -18016.485   3575417.6

 

* Variance covariance matrix is symmetric because Cov (X1, X2)= Cov (X2, X1), so Stata only shows you the main diagonal, containing the variances of the coefficients, and the lower half of the symmetric matrix.

 

. display 7650.5407^0.5

87.467369

 

* And note that the variance of the coefficient (above, age) is the SE squared.

 

. *what about the contrast between Asians and blacks?

 

. lincom 650.race-200.race

 

 ( 1)  - 200.race + 650.race = 0

 

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

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

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

         (1) |   2182.027   638.2898     3.42   0.001     930.9806    3433.074

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

 

* Asians earn significantly more than blacks, now let’s recreate that SE (638) from the Variance Covariance matrix.

 

. *OK, and now let's use the Variance Covariance matrix to generate that same SE, which is going to be sqrt(varx1 +varx2-2cov(x1,x2)). Go back to my PDF on means and variances for the formula.

 

. matrix VC=e(V)

 

. matrix list VC

 

symmetric VC[10,10]

                                                                             100b.        200.        300.

                  age      age_sq       yrsed     married        male        race        race        race

      age   7640.2094

   age_sq  -86.157016   .98616843

    yrsed  -134.03946   1.8818845   1483.4035

  married  -2133.9449   20.533356  -423.14483   57870.827

     male  -77.007314   1.2186348  -34.320357  -502.37335   49384.263

100b.race           0           0           0           0           0           0

 200.race  -483.59055   6.6633063   634.97375   13857.211   2129.1696           0   120616.88

 300.race   272.13585  -1.7595027   1485.8529   4869.0456   570.44689           0   16997.268   1397026.8

 650.race   563.21372  -4.0685094  -934.51661  -1567.6385   1318.4951           0   14405.105   14028.879

    _cons  -156200.51   1730.2182  -17685.649   17681.931  -22737.229           0  -26294.339  -46835.248

 

                  650.           

                 race       _cons

 650.race    315607.2

    _cons  -18016.485   3575417.6

 

. display (120616.88+315607.2 -2*(14405.105))^0.5

638.2898

 

. That was the SE of the lincom comparison above.

unrecognized command:  That

r(199);

 

. log close

      name:  <unnamed>

       log:  C:\Users\Michael\Documents\newer web pages\soc_meth_proj3\fall_2016_logs\class8.log

  log type:  text

 closed on:  19 Oct 2016, 13:40:34

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