knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Loading Libraries

library(hayashir)
library(dplyr)
library(stargazer)
library(AER)

Inspecting the data

str(griliches)

Table 3.1

to_summarize <- griliches %>%
                    select(age, education, log_wage, kww_score, iq_score, experience)

stargazer(as.data.frame(to_summarize), type = "html")

Notice that because we are using the Blackburn-Neumark data rather than copying the data from Griliches directly we get slightly different results.

Table 3.2

First we estimate the three models. We again expect slightly different results because (i) we have different data than Griliches; and (ii) the controls are slightly different - due to data availability.

model1 <- lm(log_wage ~ education + 
                 experience + tenure +
                 southern_residence + lives_metro + 
                 age + I(age^2) + married, 
                 data = griliches)
model2 <- lm(log_wage ~ education + iq_score + 
                 experience + tenure +
                 southern_residence + lives_metro + 
                 age + I(age^2) + married, 
                 data = griliches)
model3 <- ivreg(log_wage ~ education + iq_score + 
                     experience + tenure +
                     southern_residence + lives_metro +  
                     age + I(age^2) + married | 
                     . -iq_score + kww_score + mothers_educ,
                    data = griliches)

Let's put them all into a table, we use Std Errors in parentheses, not t-stats:

stargazer(model1, model2, model3, type = "html",
          keep = c("education", "iq_score", "experience",
                  "tenure")
          )


lachlandeer/hayashir documentation built on Feb. 9, 2023, 2:01 p.m.