Variables proxy

Datos

La base de datos wage2 está contenida en el paquete ec1027:

wage2 <- read.csv2("http://jcpernias.com/ec1027/data/wage2.csv")

Además necsitaremos los siguientes paquetes de R:

sandwich
matrices de covarianzas robustas a heteroscedasticidad.
lmtest
contrastes de hipótesis.
library(sandwich)
library(lmtest)

Creamos nuevas variables

wage2$lwage <- log(wage2$wage)

Modelo base

mod0 <- lm (lwage ~ educ + exper + tenure + married +
              black + south + urban, data = wage2)
summary(mod0)
Call:
lm(formula = lwage ~ educ + exper + tenure + married + black + 
    south + urban, data = wage2)

Residuals:
     Min       1Q   Median       3Q      Max 
-1.99455 -0.21849  0.00399  0.23543  1.18806 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  5.347446   0.131236  40.747  < 2e-16 ***
educ         0.067980   0.007142   9.519  < 2e-16 ***
exper        0.015857   0.003870   4.097 4.71e-05 ***
tenure       0.008881   0.002917   3.045  0.00242 ** 
married      0.204780   0.046904   4.366 1.47e-05 ***
black       -0.170976   0.052549  -3.254  0.00120 ** 
south       -0.073874   0.030724  -2.404  0.01648 *  
urban        0.202143   0.031584   6.400 2.96e-10 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.3588 on 655 degrees of freedom
Multiple R-squared:  0.2505,	Adjusted R-squared:  0.2425 
F-statistic: 31.27 on 7 and 655 DF,  p-value: < 2.2e-16

Modelo base + IQ

mod1 <- lm (lwage ~ educ + exper + tenure + married +
              black + south + urban + IQ, data = wage2)
summary(mod1)
Call:
lm(formula = lwage ~ educ + exper + tenure + married + black + 
    south + urban + IQ, data = wage2)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.03002 -0.21285  0.00213  0.21964  1.23932 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  5.124685   0.147241  34.805  < 2e-16 ***
educ         0.055111   0.008122   6.785 2.60e-11 ***
exper        0.015917   0.003842   4.142 3.89e-05 ***
tenure       0.008717   0.002896   3.010  0.00271 ** 
married      0.203796   0.046566   4.376 1.40e-05 ***
black       -0.122364   0.054275  -2.255  0.02449 *  
south       -0.063294   0.030676  -2.063  0.03948 *  
urban        0.200542   0.031360   6.395 3.06e-10 ***
IQ           0.003844   0.001184   3.248  0.00122 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.3562 on 654 degrees of freedom
Multiple R-squared:  0.2624,	Adjusted R-squared:  0.2534 
F-statistic: 29.08 on 8 and 654 DF,  p-value: < 2.2e-16

Modelo base + KWW

mod2 <- lm (lwage ~ educ + exper + tenure + married +
              black + south + urban + KWW, data = wage2)
summary(mod2)
Call:
lm(formula = lwage ~ educ + exper + tenure + married + black + 
    south + urban + KWW, data = wage2)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.07388 -0.21914 -0.00078  0.23543  1.25829 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  5.305182   0.131440  40.362  < 2e-16 ***
educ         0.058322   0.007905   7.378 4.90e-13 ***
exper        0.013669   0.003929   3.479 0.000537 ***
tenure       0.007851   0.002925   2.684 0.007460 ** 
married      0.197103   0.046744   4.217 2.83e-05 ***
black       -0.140049   0.053444  -2.620 0.008984 ** 
south       -0.074818   0.030569  -2.448 0.014646 *  
urban        0.192933   0.031595   6.106 1.75e-09 ***
KWW          0.006025   0.002162   2.787 0.005469 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.3569 on 654 degrees of freedom
Multiple R-squared:  0.2593,	Adjusted R-squared:  0.2502 
F-statistic: 28.62 on 8 and 654 DF,  p-value: < 2.2e-16

Modelo base + IQ + KWW

mod3 <- lm (lwage ~ educ + exper + tenure + married +
              black + south + urban + IQ + KWW, data = wage2)
summary(mod3)
Call:
lm(formula = lwage ~ educ + exper + tenure + married + black + 
    south + urban + IQ + KWW, data = wage2)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.08843 -0.20870  0.00105  0.23653  1.22717 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  5.121755   0.146822  34.884  < 2e-16 ***
educ         0.049182   0.008540   5.759 1.30e-08 ***
exper        0.014163   0.003914   3.618 0.000319 ***
tenure       0.007918   0.002911   2.720 0.006696 ** 
married      0.197805   0.046512   4.253 2.42e-05 ***
black       -0.104401   0.054736  -1.907 0.056912 .  
south       -0.065510   0.030604  -2.141 0.032681 *  
urban        0.193412   0.031439   6.152 1.33e-09 ***
IQ           0.003313   0.001205   2.749 0.006140 ** 
KWW          0.004809   0.002196   2.190 0.028873 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.3552 on 653 degrees of freedom
Multiple R-squared:  0.2678,	Adjusted R-squared:  0.2577 
F-statistic: 26.53 on 9 and 653 DF,  p-value: < 2.2e-16