knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(hayashir) library(dplyr) library(stargazer) library(AER)
str(griliches)
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.
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") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.