The data files used for the examples in this text can be downloaded in a zip file from the Stata Web site. You can then use a program such as zip to unzip the data files.
Example 18.2 on page 619 using jtrain2.dta.
use jtrain2, clear
probit train re74 re75 age agesq nodegree married black hisp, nolog
Probit estimates Number of obs = 445
LR chi2(8) = 16.07
Prob > chi2 = 0.0415
Log likelihood = -294.06748 Pseudo R2 = 0.0266
------------------------------------------------------------------------------
train | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
re74 | -.0189577 .0159392 -1.19 0.234 -.0501979 .0122825
re75 | .0371871 .0271086 1.37 0.170 -.0159447 .090319
age | -.0005467 .0534045 -0.01 0.992 -.1052176 .1041242
agesq | .0000719 .0008734 0.08 0.934 -.0016399 .0017837
nodegree | -.44195 .1515457 -2.92 0.004 -.7389742 -.1449258
married | .091519 .1726192 0.53 0.596 -.2468083 .4298464
black | -.1446253 .2271609 -0.64 0.524 -.5898524 .3006019
hisp | -.5004545 .3079227 -1.63 0.104 -1.103972 .1030629
_cons | .2284561 .8154273 0.28 0.779 -1.369752 1.826664
------------------------------------------------------------------------------
predict propensity, p
reg re78 train propensity
Source | SS df MS Number of obs = 445
-------------+------------------------------ F( 2, 442) = 5.00
Model | 432.165422 2 216.082711 Prob > F = 0.0071
Residual | 19093.4912 442 43.1979439 R-squared = 0.0221
-------------+------------------------------ Adj R-squared = 0.0177
Total | 19525.6566 444 43.9767041 Root MSE = 6.5725
------------------------------------------------------------------------------
re78 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
train | 1.625741 .6436153 2.53 0.012 .360815 2.890668
propensity | 4.74316 3.398343 1.40 0.163 -1.935758 11.42208
_cons | 2.65396 1.421591 1.87 0.063 -.1399571 5.447877
------------------------------------------------------------------------------
reg re78 train re74 re75 age agesq nodegree married black hisp
Source | SS df MS Number of obs = 445
-------------+------------------------------ F( 9, 435) = 2.49
Model | 955.909613 9 106.212179 Prob > F = 0.0088
Residual | 18569.747 435 42.6890736 R-squared = 0.0490
-------------+------------------------------ Adj R-squared = 0.0293
Total | 19525.6566 444 43.9767041 Root MSE = 6.5337
------------------------------------------------------------------------------
re78 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
train | 1.625166 .6399454 2.54 0.011 .3673965 2.882935
re74 | .0730643 .0775264 0.94 0.346 -.0793087 .2254373
re75 | .0651047 .1357642 0.48 0.632 -.2017307 .3319401
age | .2006381 .272712 0.74 0.462 -.3353589 .7366351
agesq | -.0025326 .0044565 -0.57 0.570 -.0112916 .0062264
nodegree | -1.099426 .7914955 -1.39 0.166 -2.655057 .4562048
married | -.1052808 .8930025 -0.12 0.906 -1.860417 1.649855
black | -2.115677 1.172482 -1.80 0.072 -4.42011 .188757
hisp | -.0095228 1.551503 -0.01 0.995 -3.058898 3.039852
_cons | 3.691303 4.180235 0.88 0.378 -4.524666 11.90727
------------------------------------------------------------------------------
reg re78 train /*simple comparison*/
Source | SS df MS Number of obs = 445
-------------+------------------------------ F( 1, 443) = 8.04
Model | 348.013451 1 348.013451 Prob > F = 0.0048
Residual | 19177.6432 443 43.2903909 R-squared = 0.0178
-------------+------------------------------ Adj R-squared = 0.0156
Total | 19525.6566 444 43.9767041 Root MSE = 6.5795
------------------------------------------------------------------------------
re78 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
train | 1.794343 .6328536 2.84 0.005 .5505749 3.038111
_cons | 4.554802 .408046 11.16 0.000 3.752856 5.356749
------------------------------------------------------------------------------
sum propensity
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
propensity | 445 .4155321 .0934459 .1638736 .6738951
gen wp = train*(propensity-r(mean))
reg re78 train propensity wp /*adding the interaction term*/
Source | SS df MS Number of obs = 445
-------------+------------------------------ F( 3, 441) = 4.61
Model | 593.815328 3 197.938443 Prob > F = 0.0034
Residual | 18931.8413 441 42.9293453 R-squared = 0.0304
-------------+------------------------------ Adj R-squared = 0.0238
Total | 19525.6566 444 43.9767041 Root MSE = 6.552
------------------------------------------------------------------------------
re78 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
train | 1.554095 .6426726 2.42 0.016 .2910138 2.817177
propensity | -.9943707 4.496586 -0.22 0.825 -9.831772 7.84303
wp | 13.26973 6.838352 1.94 0.053 -.1700793 26.70954
_cons | 4.953301 1.847272 2.68 0.008 1.32275 8.583851
------------------------------------------------------------------------------
Example 18.3 on page 624 using fertil2.dta.
use fertil2, clear
reg children educ7 age agesq evermarr urban electric tv
Source | SS df MS Number of obs = 4358
-------------+------------------------------ F( 7, 4350) = 880.03
Model | 12607.4006 7 1801.05723 Prob > F = 0.0000
Residual | 8902.63153 4350 2.04658196 R-squared = 0.5861
-------------+------------------------------ Adj R-squared = 0.5855
Total | 21510.0321 4357 4.93689055 Root MSE = 1.4306
------------------------------------------------------------------------------
children | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ7 | -.3935524 .0495534 -7.94 0.000 -.4907024 -.2964025
age | .2719307 .0171033 15.90 0.000 .2383996 .3054618
agesq | -.001896 .0002752 -6.89 0.000 -.0024356 -.0013564
evermarr | .6947417 .0523984 13.26 0.000 .5920142 .7974691
urban | -.2437082 .0460252 -5.30 0.000 -.333941 -.1534753
electric | -.336644 .0754557 -4.46 0.000 -.4845756 -.1887124
tv | -.3259749 .0897716 -3.63 0.000 -.501973 -.1499767
_cons | -3.526605 .2451026 -14.39 0.000 -4.007131 -3.046079
------------------------------------------------------------------------------
ivreg children (educ7 =frsthalf ) age agesq evermarr urban electric tv
Instrumental variables (2SLS) regression
Source | SS df MS Number of obs = 4358
-------------+------------------------------ F( 7, 4350) = 829.33
Model | 12154.5373 7 1736.36247 Prob > F = 0.0000
Residual | 9355.49483 4350 2.15068847 R-squared = 0.5651
-------------+------------------------------ Adj R-squared = 0.5644
Total | 21510.0321 4357 4.93689055 Root MSE = 1.4665
------------------------------------------------------------------------------
children | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ7 | -1.13068 .6192352 -1.83 0.068 -2.344696 .0833367
age | .2627018 .01916 13.71 0.000 .2251385 .3002651
agesq | -.0019787 .0002905 -6.81 0.000 -.0025483 -.0014091
evermarr | .6167576 .0845468 7.29 0.000 .4510028 .7825123
urban | -.1672413 .0795281 -2.10 0.036 -.3231569 -.0113257
electric | -.2343255 .1154192 -2.03 0.042 -.460606 -.0080451
tv | -.1371643 .1829146 -0.75 0.453 -.4957701 .2214415
_cons | -2.83005 .6350035 -4.46 0.000 -4.07498 -1.58512
------------------------------------------------------------------------------
Instrumented: educ7
Instruments: age agesq evermarr urban electric tv frsthalf
------------------------------------------------------------------------------
probit educ7 frsthalf age agesq evermarr urban electric tv, nolog
Probit estimates Number of obs = 4358
LR chi2(7) = 1130.84
Prob > chi2 = 0.0000
Log likelihood = -2428.384 Pseudo R2 = 0.1889
------------------------------------------------------------------------------
educ7 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
frsthalf | -.2206627 .0418563 -5.27 0.000 -.3026995 -.1386259
age | -.0150337 .0174845 -0.86 0.390 -.0493027 .0192354
agesq | -.0007325 .0002897 -2.53 0.011 -.0013003 -.0001647
evermarr | -.2972879 .0486734 -6.11 0.000 -.392686 -.2018898
urban | .2998122 .0432321 6.93 0.000 .2150789 .3845456
electric | .4246668 .0751255 5.65 0.000 .2774235 .57191
tv | .9281707 .0977462 9.50 0.000 .7365915 1.11975
_cons | 1.13537 .2440057 4.65 0.000 .6571273 1.613612
------------------------------------------------------------------------------
predict propensity, p /*procedure 18.1*/
(3 missing values generated)
ivreg children (educ7= propensity) age agesq evermarr urban electric tv
Instrumental variables (2SLS) regression
Source | SS df MS Number of obs = 4358
-------------+------------------------------ F( 7, 4350) = 710.92
Model | 10524.2446 7 1503.46351 Prob > F = 0.0000
Residual | 10985.7876 4350 2.52546841 R-squared = 0.4893
-------------+------------------------------ Adj R-squared = 0.4884
Total | 21510.0321 4357 4.93689055 Root MSE = 1.5892
------------------------------------------------------------------------------
children | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ7 | -1.974509 .331779 -5.95 0.000 -2.624964 -1.324053
age | .252137 .0194358 12.97 0.000 .2140329 .290241
agesq | -.0020734 .0003079 -6.73 0.000 -.0026772 -.0014697
evermarr | .527485 .0677212 7.79 0.000 .3947169 .6602531
urban | -.0797056 .0613673 -1.30 0.194 -.2000168 .0406056
electric | -.1171961 .0953328 -1.23 0.219 -.3040969 .0697047
tv | .0789773 .1302613 0.61 0.544 -.1764013 .3343558
_cons | -2.032667 .4119708 -4.93 0.000 -2.840339 -1.224994
------------------------------------------------------------------------------
Instrumented: educ7
Instruments: age agesq evermarr urban electric tv propensity
------------------------------------------------------------------------------
ivreg children (educ7= propensity) age agesq evermarr urban electric tv, robust
IV (2SLS) regression with robust standard errors Number of obs = 4358
F( 7, 4350) = 678.11
Prob > F = 0.0000
R-squared = 0.4893
Root MSE = 1.5892
------------------------------------------------------------------------------
| Robust
children | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ7 | -1.974509 .3135566 -6.30 0.000 -2.589239 -1.359778
age | .252137 .0210049 12.00 0.000 .2109566 .2933173
agesq | -.0020734 .0003816 -5.43 0.000 -.0028215 -.0013254
evermarr | .527485 .0695789 7.58 0.000 .391075 .663895
urban | -.0797056 .0605259 -1.32 0.188 -.1983672 .038956
electric | -.1171961 .0891859 -1.31 0.189 -.2920458 .0576536
tv | .0789773 .1084846 0.73 0.467 -.1337078 .2916623
_cons | -2.032667 .3642986 -5.58 0.000 -2.746877 -1.318456
------------------------------------------------------------------------------
Instrumented: educ7
Instruments: age agesq evermarr urban electric tv propensity
------------------------------------------------------------------------------
