Chapter 15: Instrumental Variables Estimation and Two Stage Least Squares

with tags instrumental-variables iv -
library(AER)
library(wooldridge)

Example 15.1

data("mroz")

OLS

s.lm.1 <- summary(lm(lwage ~ educ, data = mroz))
s.lm.1
## 
## Call:
## lm(formula = lwage ~ educ, data = mroz)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3.10256 -0.31473  0.06434  0.40081  2.10029 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -0.1852     0.1852  -1.000    0.318    
## educ          0.1086     0.0144   7.545 2.76e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.68 on 426 degrees of freedom
##   (325 observations deleted due to missingness)
## Multiple R-squared:  0.1179, Adjusted R-squared:  0.1158 
## F-statistic: 56.93 on 1 and 426 DF,  p-value: 2.761e-13

fatheduc as IV for educ

s.lm.2 <- summary(lm(educ ~ fatheduc, data = mroz[mroz$inlf !=0 ,]))
s.lm.2
## 
## Call:
## lm(formula = educ ~ fatheduc, data = mroz[mroz$inlf != 0, ])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.4704 -1.1231 -0.1231  0.9546  5.9546 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 10.23705    0.27594  37.099   <2e-16 ***
## fatheduc     0.26944    0.02859   9.426   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.081 on 426 degrees of freedom
## Multiple R-squared:  0.1726, Adjusted R-squared:  0.1706 
## F-statistic: 88.84 on 1 and 426 DF,  p-value: < 2.2e-16

IV estimation

s.iv.1 <- summary(ivreg(lwage ~ educ | fatheduc,
                        data=mroz))
s.iv.1
## 
## Call:
## ivreg(formula = lwage ~ educ | fatheduc, data = mroz)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.0870 -0.3393  0.0525  0.4042  2.0677 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  0.44110    0.44610   0.989   0.3233  
## educ         0.05917    0.03514   1.684   0.0929 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.6894 on 426 degrees of freedom
## Multiple R-Squared: 0.09344, Adjusted R-squared: 0.09131 
## Wald test: 2.835 on 1 and 426 DF,  p-value: 0.09294

Example 15.2

data("wage2")

s.lm.1 <- summary(lm(educ ~ sibs, data = wage2))
s.lm.1
## 
## Call:
## lm(formula = educ ~ sibs, data = wage2)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -5.139 -1.683 -0.683  1.931  6.140 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 14.13879    0.11314 124.969  < 2e-16 ***
## sibs        -0.22792    0.03028  -7.528 1.22e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.134 on 933 degrees of freedom
## Multiple R-squared:  0.05726,    Adjusted R-squared:  0.05625 
## F-statistic: 56.67 on 1 and 933 DF,  p-value: 1.215e-13
s.iv.1 <- summary(ivreg(lwage ~ educ | sibs, data = wage2))
s.iv.1
## 
## Call:
## ivreg(formula = lwage ~ educ | sibs, data = wage2)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.85429 -0.26950  0.04223  0.29276  1.31038 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  5.13003    0.35517  14.444  < 2e-16 ***
## educ         0.12243    0.02635   4.646 3.86e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4233 on 933 degrees of freedom
## Multiple R-Squared: -0.009174,   Adjusted R-squared: -0.01026 
## Wald test: 21.59 on 1 and 933 DF,  p-value: 3.865e-06

Example 15.3

data("bwght")

s.lm.1 <- summary(lm(packs ~ cigprice, data = bwght))
s.lm.1
## 
## Call:
## lm(formula = packs ~ cigprice, data = bwght)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.1106 -0.1061 -0.1032 -0.1015  2.4016 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0674257  0.1025384   0.658    0.511
## cigprice    0.0002829  0.0007830   0.361    0.718
## 
## Residual standard error: 0.2987 on 1386 degrees of freedom
## Multiple R-squared:  9.417e-05,  Adjusted R-squared:  -0.0006273 
## F-statistic: 0.1305 on 1 and 1386 DF,  p-value: 0.7179
s.iv.1 <- summary(ivreg(lbwght ~ packs | cigprice,
                        data = bwght))
s.iv.1
## 
## Call:
## ivreg(formula = lbwght ~ packs | cigprice, data = bwght)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -7.4200  0.1368  0.3055  0.4194  1.1540 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   4.4481     0.9082   4.898 1.08e-06 ***
## packs         2.9887     8.6989   0.344    0.731    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9389 on 1386 degrees of freedom
## Multiple R-Squared: -23.23,  Adjusted R-squared: -23.25 
## Wald test: 0.118 on 1 and 1386 DF,  p-value: 0.7312

Example 15.4

data("card")

s.lm.1 <- summary(lm(educ ~ nearc4 + exper + expersq + black + smsa + south +
                       smsa66 + reg662 + reg663 + reg664 + reg665 + reg666 + reg667 +
                       reg668 + reg669,
                     data = card))
s.lm.1
## 
## Call:
## lm(formula = educ ~ nearc4 + exper + expersq + black + smsa + 
##     south + smsa66 + reg662 + reg663 + reg664 + reg665 + reg666 + 
##     reg667 + reg668 + reg669, data = card)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.545 -1.370 -0.091  1.278  6.239 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 16.6382529  0.2406297  69.145  < 2e-16 ***
## nearc4       0.3198989  0.0878638   3.641 0.000276 ***
## exper       -0.4125334  0.0336996 -12.241  < 2e-16 ***
## expersq      0.0008686  0.0016504   0.526 0.598728    
## black       -0.9355287  0.0937348  -9.981  < 2e-16 ***
## smsa         0.4021825  0.1048112   3.837 0.000127 ***
## south       -0.0516126  0.1354284  -0.381 0.703152    
## smsa66       0.0254805  0.1057692   0.241 0.809644    
## reg662      -0.0786363  0.1871154  -0.420 0.674329    
## reg663      -0.0279390  0.1833745  -0.152 0.878913    
## reg664       0.1171820  0.2172531   0.539 0.589665    
## reg665      -0.2726165  0.2184204  -1.248 0.212082    
## reg666      -0.3028147  0.2370712  -1.277 0.201590    
## reg667      -0.2168177  0.2343879  -0.925 0.355021    
## reg668       0.5238914  0.2674749   1.959 0.050246 .  
## reg669       0.2102710  0.2024568   1.039 0.299076    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.941 on 2994 degrees of freedom
## Multiple R-squared:  0.4771, Adjusted R-squared:  0.4745 
## F-statistic: 182.1 on 15 and 2994 DF,  p-value: < 2.2e-16
s.lm.2 <- summary(lm.2 <- lm(lwage ~ educ + exper + expersq + black + smsa + south +
                               smsa66 + reg662 + reg663 + reg664 + reg665 + reg666 + reg667 +
                               reg668 + reg669,
                             data = card))
s.lm.2
## 
## Call:
## lm(formula = lwage ~ educ + exper + expersq + black + smsa + 
##     south + smsa66 + reg662 + reg663 + reg664 + reg665 + reg666 + 
##     reg667 + reg668 + reg669, data = card)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.62326 -0.22141  0.02001  0.23932  1.33340 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  4.6208068  0.0742327  62.248  < 2e-16 ***
## educ         0.0746933  0.0034983  21.351  < 2e-16 ***
## exper        0.0848320  0.0066242  12.806  < 2e-16 ***
## expersq     -0.0022870  0.0003166  -7.223 6.41e-13 ***
## black       -0.1990123  0.0182483 -10.906  < 2e-16 ***
## smsa         0.1363845  0.0201005   6.785 1.39e-11 ***
## south       -0.1479550  0.0259799  -5.695 1.35e-08 ***
## smsa66       0.0262417  0.0194477   1.349  0.17733    
## reg662       0.0963672  0.0358979   2.684  0.00730 ** 
## reg663       0.1445400  0.0351244   4.115 3.97e-05 ***
## reg664       0.0550756  0.0416573   1.322  0.18623    
## reg665       0.1280248  0.0418395   3.060  0.00223 ** 
## reg666       0.1405174  0.0452469   3.106  0.00192 ** 
## reg667       0.1179810  0.0448025   2.633  0.00850 ** 
## reg668      -0.0564361  0.0512579  -1.101  0.27098    
## reg669       0.1185698  0.0388301   3.054  0.00228 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3723 on 2994 degrees of freedom
## Multiple R-squared:  0.2998, Adjusted R-squared:  0.2963 
## F-statistic: 85.48 on 15 and 2994 DF,  p-value: < 2.2e-16
s.iv.1 <- summary(ivreg(lwage ~ educ + exper + expersq + black + smsa + south +
                          smsa66 + reg662 + reg663 + reg664 + reg665 + reg666 + reg667 +
                          reg668 + reg669 | nearc4 + exper + expersq + black + smsa + south +
                          smsa66 + reg662 + reg663 + reg664 + reg665 + reg666 + reg667 +
                          reg668 + reg669,
                        data = card))
s.iv.1
## 
## Call:
## ivreg(formula = lwage ~ educ + exper + expersq + black + smsa + 
##     south + smsa66 + reg662 + reg663 + reg664 + reg665 + reg666 + 
##     reg667 + reg668 + reg669 | nearc4 + exper + expersq + black + 
##     smsa + south + smsa66 + reg662 + reg663 + reg664 + reg665 + 
##     reg666 + reg667 + reg668 + reg669, data = card)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.83164 -0.24075  0.02428  0.25208  1.42760 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  3.6661509  0.9248295   3.964 7.54e-05 ***
## educ         0.1315038  0.0549637   2.393  0.01679 *  
## exper        0.1082711  0.0236586   4.576 4.92e-06 ***
## expersq     -0.0023349  0.0003335  -7.001 3.12e-12 ***
## black       -0.1467757  0.0538999  -2.723  0.00650 ** 
## smsa         0.1118083  0.0316620   3.531  0.00042 ***
## south       -0.1446715  0.0272846  -5.302 1.23e-07 ***
## smsa66       0.0185311  0.0216086   0.858  0.39119    
## reg662       0.1007678  0.0376857   2.674  0.00754 ** 
## reg663       0.1482588  0.0368141   4.027 5.78e-05 ***
## reg664       0.0498971  0.0437398   1.141  0.25406    
## reg665       0.1462719  0.0470639   3.108  0.00190 ** 
## reg666       0.1629029  0.0519096   3.138  0.00172 ** 
## reg667       0.1345722  0.0494023   2.724  0.00649 ** 
## reg668      -0.0830770  0.0593314  -1.400  0.16155    
## reg669       0.1078142  0.0418137   2.578  0.00997 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3883 on 2994 degrees of freedom
## Multiple R-Squared: 0.2382,  Adjusted R-squared: 0.2343 
## Wald test: 51.01 on 15 and 2994 DF,  p-value: < 2.2e-16

Example 15.5

data("mroz")

s.lm.1 <- summary(lm.1 <- lm(lwage ~ educ + exper + expersq, data = mroz))
s.lm.1
## 
## Call:
## lm(formula = lwage ~ educ + exper + expersq, data = mroz)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3.08404 -0.30627  0.04952  0.37498  2.37115 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -0.5220406  0.1986321  -2.628  0.00890 ** 
## educ         0.1074896  0.0141465   7.598 1.94e-13 ***
## exper        0.0415665  0.0131752   3.155  0.00172 ** 
## expersq     -0.0008112  0.0003932  -2.063  0.03974 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.6664 on 424 degrees of freedom
##   (325 observations deleted due to missingness)
## Multiple R-squared:  0.1568, Adjusted R-squared:  0.1509 
## F-statistic: 26.29 on 3 and 424 DF,  p-value: 1.302e-15
s.lm.2a <- summary(lm.2a <- lm(educ ~ exper + expersq + motheduc + fatheduc,
                               data = mroz[mroz$inlf > 0,]))
s.lm.2b <- summary(lm.2b <- lm(educ ~ exper + expersq,data=mroz[mroz$inlf > 0,]))

anova(lm.2a, lm.2b)
## Analysis of Variance Table
## 
## Model 1: educ ~ exper + expersq + motheduc + fatheduc
## Model 2: educ ~ exper + expersq
##   Res.Df    RSS Df Sum of Sq    F    Pr(>F)    
## 1    423 1758.6                                
## 2    425 2219.2 -2   -460.64 55.4 < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
s.iv.1 <- summary(ivreg(lwage ~ educ + exper + expersq | exper +
                          expersq + motheduc + fatheduc, data = mroz))
s.iv.1
## 
## Call:
## ivreg(formula = lwage ~ educ + exper + expersq | exper + expersq + 
##     motheduc + fatheduc, data = mroz)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.0986 -0.3196  0.0551  0.3689  2.3493 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  0.0481003  0.4003281   0.120  0.90442   
## educ         0.0613966  0.0314367   1.953  0.05147 . 
## exper        0.0441704  0.0134325   3.288  0.00109 **
## expersq     -0.0008990  0.0004017  -2.238  0.02574 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.6747 on 424 degrees of freedom
## Multiple R-Squared: 0.1357,  Adjusted R-squared: 0.1296 
## Wald test: 8.141 on 3 and 424 DF,  p-value: 2.787e-05

Example 15.6

data("wage2")

s.iv.1 <- summary(ivreg(lwage ~ educ + exper + tenure + married + south + urban + black +
                          IQ | KWW + educ + exper + tenure + married + south + urban + black,
                        data = wage2))
s.iv.1
## 
## Call:
## ivreg(formula = lwage ~ educ + exper + tenure + married + south + 
##     urban + black + IQ | KWW + educ + exper + tenure + married + 
##     south + urban + black, data = wage2)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -2.095561 -0.224017  0.006572  0.234495  1.398914 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  4.592453   0.325781  14.097  < 2e-16 ***
## educ         0.025032   0.016607   1.507  0.13206    
## exper        0.014420   0.003321   4.342 1.56e-05 ***
## tenure       0.010456   0.002601   4.020 6.30e-05 ***
## married      0.200690   0.040678   4.934 9.56e-07 ***
## south       -0.051553   0.031128  -1.656  0.09803 .  
## urban        0.176706   0.028212   6.264 5.75e-10 ***
## black       -0.022561   0.073960  -0.305  0.76040    
## IQ           0.013047   0.004934   2.644  0.00832 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3807 on 926 degrees of freedom
## Multiple R-Squared:  0.19,   Adjusted R-squared: 0.183 
## Wald test: 36.96 on 8 and 926 DF,  p-value: < 2.2e-16

Example 15.7

data("mroz")

s.lm.1 <- summary(lm.1 <- lm(lwage ~ educ + exper + expersq, data = mroz))
s.lm.1
## 
## Call:
## lm(formula = lwage ~ educ + exper + expersq, data = mroz)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3.08404 -0.30627  0.04952  0.37498  2.37115 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -0.5220406  0.1986321  -2.628  0.00890 ** 
## educ         0.1074896  0.0141465   7.598 1.94e-13 ***
## exper        0.0415665  0.0131752   3.155  0.00172 ** 
## expersq     -0.0008112  0.0003932  -2.063  0.03974 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.6664 on 424 degrees of freedom
##   (325 observations deleted due to missingness)
## Multiple R-squared:  0.1568, Adjusted R-squared:  0.1509 
## F-statistic: 26.29 on 3 and 424 DF,  p-value: 1.302e-15
s.lm.2 <- summary(lm.2 <- lm(educ ~ exper + expersq + motheduc + fatheduc,
                             data = mroz[mroz$inlf != 0,]))

s.lm.3 <- summary(lm.3 <- lm(lwage ~ educ + exper + expersq + lm.2$resid,
                             data = mroz[mroz$inlf != 0,]))

s.lm.3
## 
## Call:
## lm(formula = lwage ~ educ + exper + expersq + lm.2$resid, data = mroz[mroz$inlf != 
##     0, ])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3.03743 -0.30775  0.04191  0.40361  2.33303 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.0481003  0.3945753   0.122 0.903033    
## educ         0.0613966  0.0309849   1.981 0.048182 *  
## exper        0.0441704  0.0132394   3.336 0.000924 ***
## expersq     -0.0008990  0.0003959  -2.271 0.023672 *  
## lm.2$resid   0.0581666  0.0348073   1.671 0.095441 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.665 on 423 degrees of freedom
## Multiple R-squared:  0.1624, Adjusted R-squared:  0.1544 
## F-statistic:  20.5 on 4 and 423 DF,  p-value: 1.888e-15

Example 15.8

data("mroz")

s.iv.1 <- summary(iv.1 <- ivreg(lwage ~ educ + exper + expersq | 
                                  exper + expersq + motheduc + fatheduc,
                                data = mroz[mroz$inlf!=0,]))

s.lm.1 <- summary(lm(iv.1$resid ~ exper + expersq + motheduc + fatheduc,
                     data=mroz[mroz$inlf!=0,]))
s.lm.1
## 
## Call:
## lm(formula = iv.1$resid ~ exper + expersq + motheduc + fatheduc, 
##     data = mroz[mroz$inlf != 0, ])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.1012 -0.3124  0.0478  0.3602  2.3441 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)
## (Intercept)  1.096e-02  1.413e-01   0.078    0.938
## exper       -1.833e-05  1.333e-02  -0.001    0.999
## expersq      7.341e-07  3.985e-04   0.002    0.999
## motheduc    -6.607e-03  1.189e-02  -0.556    0.579
## fatheduc     5.782e-03  1.118e-02   0.517    0.605
## 
## Residual standard error: 0.6752 on 423 degrees of freedom
## Multiple R-squared:  0.0008833,  Adjusted R-squared:  -0.008565 
## F-statistic: 0.0935 on 4 and 423 DF,  p-value: 0.9845
428 * .0009
## [1] 0.3852
s.iv.2 <- summary(iv.2 <- ivreg(lwage ~ educ + exper + expersq | 
                                  exper + expersq + motheduc + fatheduc + huseduc,
                                data = mroz[mroz$inlf!=0,]))

s.lm.2 <- summary(lm(iv.2$resid ~ exper + expersq + motheduc + fatheduc + huseduc,
                     data = mroz[mroz$inlf!=0,]))
s.lm.2
## 
## Call:
## lm(formula = iv.2$resid ~ exper + expersq + motheduc + fatheduc + 
##     huseduc, data = mroz[mroz$inlf != 0, ])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3.07503 -0.32777  0.04156  0.37759  2.33621 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)
## (Intercept)  8.606e-03  1.773e-01   0.049    0.961
## exper        5.603e-05  1.323e-02   0.004    0.997
## expersq     -8.882e-06  3.956e-04  -0.022    0.982
## motheduc    -1.039e-02  1.187e-02  -0.875    0.382
## fatheduc     6.734e-04  1.138e-02   0.059    0.953
## huseduc      6.781e-03  1.143e-02   0.593    0.553
## 
## Residual standard error: 0.67 on 422 degrees of freedom
## Multiple R-squared:  0.002605,   Adjusted R-squared:  -0.009212 
## F-statistic: 0.2205 on 5 and 422 DF,  p-value: 0.9537
428 * .0026
## [1] 1.1128
s.iv.2
## 
## Call:
## ivreg(formula = lwage ~ educ + exper + expersq | exper + expersq + 
##     motheduc + fatheduc + huseduc, data = mroz[mroz$inlf != 0, 
##     ])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3.08378 -0.32135  0.03538  0.36934  2.35829 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -0.1868572  0.2853959  -0.655 0.512997    
## educ         0.0803918  0.0217740   3.692 0.000251 ***
## exper        0.0430973  0.0132649   3.249 0.001250 ** 
## expersq     -0.0008628  0.0003962  -2.178 0.029976 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.6693 on 424 degrees of freedom
## Multiple R-Squared: 0.1495,  Adjusted R-squared: 0.1435 
## Wald test: 11.52 on 3 and 424 DF,  p-value: 2.817e-07

Example 15.9

data("fertil1")

s.iv.1 <- summary(iv.1 <- ivreg(kids ~ educ + age + agesq + black + east + northcen +
                                  west + farm + othrural + town + smcity + y74 + y76 +
                                  y78 + y80 + y82 + y84 |
                                  meduc + feduc + age + agesq + black + east +
                                  northcen + west + farm + othrural + town + smcity +
                                  y74 + y76 + y78 + y80 + y82 + y84,
                                data = fertil1))
s.iv.1
## 
## Call:
## ivreg(formula = kids ~ educ + age + agesq + black + east + northcen + 
##     west + farm + othrural + town + smcity + y74 + y76 + y78 + 
##     y80 + y82 + y84 | meduc + feduc + age + agesq + black + east + 
##     northcen + west + farm + othrural + town + smcity + y74 + 
##     y76 + y78 + y80 + y82 + y84, data = fertil1)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.2345 -1.0206 -0.0746  0.9552  4.7457 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -7.241244   3.136642  -2.309 0.021149 *  
## educ        -0.152739   0.039223  -3.894 0.000104 ***
## age          0.523554   0.139035   3.766 0.000175 ***
## agesq       -0.005716   0.001571  -3.640 0.000286 ***
## black        1.072952   0.173715   6.176 9.18e-10 ***
## east         0.228555   0.133854   1.708 0.088008 .  
## northcen     0.374419   0.122061   3.067 0.002211 ** 
## west         0.207640   0.167657   1.238 0.215799    
## farm        -0.077002   0.151372  -0.509 0.611069    
## othrural    -0.195245   0.181551  -1.075 0.282416    
## town         0.081810   0.124682   0.656 0.511864    
## smcity       0.212500   0.160425   1.325 0.185575    
## y74          0.272129   0.172944   1.574 0.115885    
## y76         -0.094548   0.179232  -0.528 0.597939    
## y78         -0.057254   0.182554  -0.314 0.753861    
## y80         -0.053248   0.184718  -0.288 0.773196    
## y82         -0.496215   0.176589  -2.810 0.005041 ** 
## y84         -0.521360   0.177921  -2.930 0.003456 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.556 on 1111 degrees of freedom
## Multiple R-Squared: 0.1281,  Adjusted R-squared: 0.1148 
## Wald test: 7.723 on 17 and 1111 DF,  p-value: < 2.2e-16
lm.r <- lm(educ ~ meduc + feduc + age + agesq + black + east + northcen +
             west + farm + othrural + town + smcity + y74 + y76 + y78 + y80 + y82 + y84,
           data = fertil1)

lm.1 <- lm(kids ~ educ + age + agesq + black + east + northcen + west + farm +
             othrural + town + smcity + y74 + y76 + y78 + y80 + y82 + y84 + lm.r$resid,
           data = fertil1)

summary(lm.1)
## 
## Call:
## lm(formula = kids ~ educ + age + agesq + black + east + northcen + 
##     west + farm + othrural + town + smcity + y74 + y76 + y78 + 
##     y80 + y82 + y84 + lm.r$resid, data = fertil1)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.9816 -1.0100 -0.0601  0.9181  4.6688 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -7.241244   3.134883  -2.310 0.021077 *  
## educ        -0.152739   0.039201  -3.896 0.000104 ***
## age          0.523554   0.138957   3.768 0.000173 ***
## agesq       -0.005716   0.001570  -3.642 0.000283 ***
## black        1.072952   0.173618   6.180 8.99e-10 ***
## east         0.228555   0.133779   1.708 0.087831 .  
## northcen     0.374419   0.121992   3.069 0.002198 ** 
## west         0.207640   0.167563   1.239 0.215542    
## farm        -0.077002   0.151287  -0.509 0.610869    
## othrural    -0.195245   0.181449  -1.076 0.282147    
## town         0.081810   0.124612   0.657 0.511628    
## smcity       0.212500   0.160335   1.325 0.185329    
## y74          0.272129   0.172847   1.574 0.115681    
## y76         -0.094548   0.179132  -0.528 0.597734    
## y78         -0.057254   0.182451  -0.314 0.753727    
## y80         -0.053248   0.184614  -0.288 0.773072    
## y82         -0.496215   0.176490  -2.812 0.005017 ** 
## y84         -0.521360   0.177821  -2.932 0.003438 ** 
## lm.r$resid   0.031137   0.044363   0.702 0.482906    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.555 on 1110 degrees of freedom
## Multiple R-squared:  0.1299, Adjusted R-squared:  0.1158 
## F-statistic: 9.206 on 18 and 1110 DF,  p-value: < 2.2e-16

Example 15.10

data("jtrain")

d.lscrap <- with(jtrain, lscrap[year == 1988] - lscrap[year == 1987])
d.hrsemp <- with(jtrain, hrsemp[year == 1988] - hrsemp[year == 1987])
d.grant <- with(jtrain, grant[year == 1988] - grant[year == 1987])

s.iv.1 <- summary(ivreg(d.lscrap ~ d.hrsemp | d.grant))
s.iv.1
## 
## Call:
## ivreg(formula = d.lscrap ~ d.hrsemp | d.grant)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -2.308829 -0.218885 -0.008926  0.267436  2.430564 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)  
## (Intercept) -0.032668   0.126951  -0.257   0.7982  
## d.hrsemp    -0.014153   0.007915  -1.788   0.0808 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.629 on 43 degrees of freedom
## Multiple R-Squared: 0.0159,  Adjusted R-squared: -0.006984 
## Wald test: 3.198 on 1 and 43 DF,  p-value: 0.08079