# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .r
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: R
#     language: R
#     name: ir
# ---

install.packages("haven")
install.packages("plm")
install.packages("lmtest")
install.packages("sandwich")
install.packages("stargazer")
install.packages("AER")
library(haven)
library(plm)
library(lmtest)
library(sandwich)
library(stargazer)
library(AER)

paper_data <- read_dta("ImaiTakarabeData.dta")

paper_data_subset <- subset(paper_data, name != "tokyo" & 
                                        name != "osaka" & 
                                        name != "kanagawa" & 
                                        name != "aichi" & 
                                        name != "kyoto" & 
                                        name != "hyogo" & 
                                        name != "hokkaido")

reg1 <- plm(GDP ~ gland + year, 
            data = paper_data_subset,
            index = c("name", "year"),
            model = "within")

coeftest(reg1, vcov = vcovHC, type = "HC2")



StarcoderdataJupyterScriptsDedupFiltered