-------------------------------------------------------------------------------------------------
name: <unnamed>
log: C:\Users\Michael\Documents\newer web pages\soc_meth_proj3\fall_2015_381_logs\class20
> .log
log type: text
opened on: 2 Dec 2015, 10:15:21
. use "C:\Users\Michael\Documents\current class files\intro soc methods\cps_mar_2000_new with additional vars.dta", clear
. regress incwage male ib3.metro yrsed lawyers if lawyers==1 | sociologists==1
Source | SS df MS Number of obs = 447
-------------+------------------------------ F( 6, 440) = 3.75
Model | 1.0236e+11 6 1.7061e+10 Prob > F = 0.0012
Residual | 2.0010e+12 440 4.5477e+09 R-squared = 0.0487
-------------+------------------------------ Adj R-squared = 0.0357
Total | 2.1034e+12 446 4.7160e+09 Root MSE = 67437
-----------------------------------------------------------------------------------
incwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
------------------+----------------------------------------------------------------
male | 21822.54 7019.121 3.11 0.002 8027.373 35617.71
|
metro |
Not in metro a.. | -35179.04 11893.77 -2.96 0.003 -58554.7 -11803.37
Central city | -866.6961 6990.648 -0.12 0.901 -14605.91 12872.52
Central city s.. | -16129.4 12804.46 -1.26 0.208 -41294.9 9036.1
|
yrsed | 10526.86 7112.556 1.48 0.140 -3451.948 24505.66
lawyers | 14971.23 28060.59 0.53 0.594 -40178.21 70120.67
_cons | -130163.4 124066.3 -1.05 0.295 -373999.6 113672.8
-----------------------------------------------------------------------------------
*What changes when we reverse the comparison category for gender? The gender coefficient changes sign, SE stays the same, t-stat changes sign. The constant changes because comparison category across models changes. The other coefficients and the R-square don’t change.
. regress incwage female ib3.metro yrsed lawyers if lawyers==1 | sociologists==1
Source | SS df MS Number of obs = 447
-------------+------------------------------ F( 6, 440) = 3.75
Model | 1.0236e+11 6 1.7061e+10 Prob > F = 0.0012
Residual | 2.0010e+12 440 4.5477e+09 R-squared = 0.0487
-------------+------------------------------ Adj R-squared = 0.0357
Total | 2.1034e+12 446 4.7160e+09 Root MSE = 67437
-----------------------------------------------------------------------------------
incwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
------------------+----------------------------------------------------------------
female | -21822.54 7019.121 -3.11 0.002 -35617.71 -8027.373
|
metro |
Not in metro a.. | -35179.04 11893.77 -2.96 0.003 -58554.7 -11803.37
Central city | -866.6961 6990.648 -0.12 0.901 -14605.91 12872.52
Central city s.. | -16129.4 12804.46 -1.26 0.208 -41294.9 9036.1
|
yrsed | 10526.86 7112.556 1.48 0.140 -3451.948 24505.66
lawyers | 14971.23 28060.59 0.53 0.594 -40178.21 70120.67
_cons | -108340.8 124714.3 -0.87 0.385 -353450.7 136769
-----------------------------------------------------------------------------------
. lincom 2.metro-1.metro
( 1) - 1.metro + 2.metro = 0
------------------------------------------------------------------------------
incwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) | 34312.34 12062.81 2.84 0.005 10604.45 58020.23
------------------------------------------------------------------------------
. codebook metro
------------------------------------------------------------------------------------------------
metro Metropolitan central city status
------------------------------------------------------------------------------------------------
type: numeric (byte)
label: metrolbl
range: [0,4] units: 1
unique values: 5 missing .: 0/133710
tabulation: Freq. Numeric Label
340 0 Not identifiable
29658 1 Not in metro area
32481 2 Central city
51468 3 Outside central city
19763 4 Central city status unknown
. regress incwage female ib3.metro yrsed lawyers if lawyers==1 | sociologists==1
Source | SS df MS Number of obs = 447
-------------+------------------------------ F( 6, 440) = 3.75
Model | 1.0236e+11 6 1.7061e+10 Prob > F = 0.0012
Residual | 2.0010e+12 440 4.5477e+09 R-squared = 0.0487
-------------+------------------------------ Adj R-squared = 0.0357
Total | 2.1034e+12 446 4.7160e+09 Root MSE = 67437
----------------------------------------------------------------------------------------------
incwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-----------------------------+----------------------------------------------------------------
female | -21822.54 7019.121 -3.11 0.002 -35617.71 -8027.373
|
metro |
Not in metro area | -35179.04 11893.77 -2.96 0.003 -58554.7 -11803.37
Central city | -866.6961 6990.648 -0.12 0.901 -14605.91 12872.52
Central city status unknown | -16129.4 12804.46 -1.26 0.208 -41294.9 9036.1
|
yrsed | 10526.86 7112.556 1.48 0.140 -3451.948 24505.66
lawyers | 14971.23 28060.59 0.53 0.594 -40178.21 70120.67
_cons | -108340.8 124714.3 -0.87 0.385 -353450.7 136769
----------------------------------------------------------------------------------------------
* What about when we change the comparison category for metro from 3 (suburban) to 1 (rural)? Answer: all the metro coefficients look different, but the fit of the model is exactly the same, and the comparison of 2.metro to 1.metro is the same as in the above model. The constant is different (any time we change the comparison category of any variable, the constant will change).
. regress incwage female ib1.metro yrsed lawyers if lawyers==1 | sociologists==1
Source | SS df MS Number of obs = 447
-------------+------------------------------ F( 6, 440) = 3.75
Model | 1.0236e+11 6 1.7061e+10 Prob > F = 0.0012
Residual | 2.0010e+12 440 4.5477e+09 R-squared = 0.0487
-------------+------------------------------ Adj R-squared = 0.0357
Total | 2.1034e+12 446 4.7160e+09 Root MSE = 67437
----------------------------------------------------------------------------------------------
incwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-----------------------------+----------------------------------------------------------------
female | -21822.54 7019.121 -3.11 0.002 -35617.71 -8027.373
|
metro |
Central city | 34312.34 12062.81 2.84 0.005 10604.45 58020.23
Outside central city | 35179.04 11893.77 2.96 0.003 11803.37 58554.7
Central city status unknown | 19049.64 16054.28 1.19 0.236 -12502.96 50602.24
|
yrsed | 10526.86 7112.556 1.48 0.140 -3451.948 24505.66
lawyers | 14971.23 28060.59 0.53 0.594 -40178.21 70120.67
_cons | -143519.9 125052.8 -1.15 0.252 -389295 102255.2
----------------------------------------------------------------------------------------------
* What if we add our friends the nurses in? Adding new cases changes everything, the R-square, and all coefficients, and so on.
. regress incwage female ib1.metro yrsed lawyers nurses if lawyers==1 | sociologists==1 |nurses==1
Source | SS df MS Number of obs = 1413
-------------+------------------------------ F( 8, 1404) = 34.53
Model | 4.8689e+11 8 6.0862e+10 Prob > F = 0.0000
Residual | 2.4744e+12 1404 1.7624e+09 R-squared = 0.1644
-------------+------------------------------ Adj R-squared = 0.1597
Total | 2.9612e+12 1412 2.0972e+09 Root MSE = 41980
----------------------------------------------------------------------------------------------
incwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-----------------------------+----------------------------------------------------------------
female | -17382.34 3411.092 -5.10 0.000 -24073.73 -10690.96
|
metro |
Not identifiable | 9055.471 21169.8 0.43 0.669 -32472.38 50583.33
Central city | 11008.95 3637.772 3.03 0.003 3872.901 18145.01
Outside central city | 11563.4 3232.891 3.58 0.000 5221.585 17905.22
Central city status unknown | 5087.729 3985.776 1.28 0.202 -2730.99 12906.45
|
yrsed | 1901.495 832.8057 2.28 0.023 267.8173 3535.172
lawyers | 22910.76 17329.64 1.32 0.186 -11084.01 56905.54
nurses | 2144.799 17262.35 0.12 0.901 -31717.97 36007.57
_cons | 14233.9 22357.43 0.64 0.524 -29623.66 58091.46
----------------------------------------------------------------------------------------------
*On the other hand, if we have no other predictors in the model, then the predicted values for lawyers, nurses will equal their coefficients plus the constant, and the sociologists predicted values will equal the constant. And since there are 3 terms and 3 categories, the predicted and actual income values for the 3 groups will be the same.
. regress incwage lawyers nurses if lawyers==1 | sociologists==1 |nurses==1
Source | SS df MS Number of obs = 1413
-------------+------------------------------ F( 2, 1410) = 111.34
Model | 4.0387e+11 2 2.0194e+11 Prob > F = 0.0000
Residual | 2.5574e+12 1410 1.8137e+09 R-squared = 0.1364
-------------+------------------------------ Adj R-squared = 0.1352
Total | 2.9612e+12 1412 2.0972e+09 Root MSE = 42588
------------------------------------------------------------------------------
incwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lawyers | 32535.99 17504.37 1.86 0.063 -1801.409 66873.4
nurses | -3971.481 17440.4 -0.23 0.820 -38183.41 30240.45
_cons | 41508.33 17386.49 2.39 0.017 7402.162 75614.5
------------------------------------------------------------------------------
* And if we get rid of the nurses, the lawyers’ coefficient and the constant will be the same again, though the R-square and the n of the models above and below are different, and the SE of both coefficient and constant will be different (because the presence of the nurses changes the variance of income for everyone).
. regress incwage lawyers if lawyers==1 | sociologists==1
Source | SS df MS Number of obs = 447
-------------+------------------------------ F( 1, 445) = 1.33
Model | 6.2663e+09 1 6.2663e+09 Prob > F = 0.2495
Residual | 2.0971e+12 445 4.7125e+09 R-squared = 0.0030
-------------+------------------------------ Adj R-squared = 0.0007
Total | 2.1034e+12 446 4.7160e+09 Root MSE = 68648
------------------------------------------------------------------------------
incwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lawyers | 32535.99 28215.44 1.15 0.249 -22916.07 87988.05
_cons | 41508.33 28025.43 1.48 0.139 -13570.31 96586.97
------------------------------------------------------------------------------
. regress incwage female ib1.metro yrsed lawyers nurses if lawyers==1 | sociologists==1 |nurses==1
Source | SS df MS Number of obs = 1413
-------------+------------------------------ F( 8, 1404) = 34.53
Model | 4.8689e+11 8 6.0862e+10 Prob > F = 0.0000
Residual | 2.4744e+12 1404 1.7624e+09 R-squared = 0.1644
-------------+------------------------------ Adj R-squared = 0.1597
Total | 2.9612e+12 1412 2.0972e+09 Root MSE = 41980
----------------------------------------------------------------------------------------------
incwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-----------------------------+----------------------------------------------------------------
female | -17382.34 3411.092 -5.10 0.000 -24073.73 -10690.96
|
metro |
Not identifiable | 9055.471 21169.8 0.43 0.669 -32472.38 50583.33
Central city | 11008.95 3637.772 3.03 0.003 3872.901 18145.01
Outside central city | 11563.4 3232.891 3.58 0.000 5221.585 17905.22
Central city status unknown | 5087.729 3985.776 1.28 0.202 -2730.99 12906.45
|
yrsed | 1901.495 832.8057 2.28 0.023 267.8173 3535.172
lawyers | 22910.76 17329.64 1.32 0.186 -11084.01 56905.54
nurses | 2144.799 17262.35 0.12 0.901 -31717.97 36007.57
_cons | 14233.9 22357.43 0.64 0.524 -29623.66 58091.46
----------------------------------------------------------------------------------------------
* Last question: how does change of scale change things? If we change from years of education to months of education, the fit of the model and the n are unchanged, and all the other coefficients are unchanged. The constant is unchanged because 0 years of education is the same group as have 0 months of education. The coefficient for months of education is 1/12 that of the coefficient for years of ed and the SE is similarly 1/12 as large. The t-statistic is the same.
. regress incwage female ib1.metro months_ed lawyers nurses if lawyers==1 | sociologists==1 |nurses==1
Source | SS df MS Number of obs = 1413
-------------+------------------------------ F( 8, 1404) = 34.53
Model | 4.8689e+11 8 6.0862e+10 Prob > F = 0.0000
Residual | 2.4744e+12 1404 1.7624e+09 R-squared = 0.1644
-------------+------------------------------ Adj R-squared = 0.1597
Total | 2.9612e+12 1412 2.0972e+09 Root MSE = 41980
----------------------------------------------------------------------------------------------
incwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-----------------------------+----------------------------------------------------------------
female | -17382.34 3411.092 -5.10 0.000 -24073.73 -10690.96
|
metro |
Not identifiable | 9055.471 21169.8 0.43 0.669 -32472.38 50583.33
Central city | 11008.95 3637.772 3.03 0.003 3872.901 18145.01
Outside central city | 11563.4 3232.891 3.58 0.000 5221.585 17905.22
Central city status unknown | 5087.729 3985.776 1.28 0.202 -2730.99 12906.45
|
months_ed | 158.4579 69.40048 2.28 0.023 22.31811 294.5977
lawyers | 22910.76 17329.64 1.32 0.186 -11084.01 56905.54
nurses | 2144.799 17262.35 0.12 0.901 -31717.97 36007.57
_cons | 14233.9 22357.43 0.64 0.524 -29623.66 58091.46
----------------------------------------------------------------------------------------------
. display 1901.495/12
158.45792
. display 832.81/12
69.400833
. log close
name: <unnamed>
log: C:\Users\Michael\Documents\newer web pages\soc_meth_proj3\fall_2015_381_logs\class2
> 0.log
log type: text
closed on: 2 Dec 2015, 12:42:55
------------------------------------------------------------------------------------------------