diff --git a/R/basque.R b/R/basque.R deleted file mode 100644 index e64e178..0000000 --- a/R/basque.R +++ /dev/null @@ -1,54 +0,0 @@ -require(Synth) - -data(basque) - -treated.regions <- 'Basque Country (Pais Vasco)' -control.regions <- c('Spain (Espana)', 'Andalucia', 'Aragon', - 'Principado De Asturias', 'Baleares (Islas)', 'Canarias', - 'Cantabria', 'Castilla Y Leon', 'Castilla-La Mancha', - 'Cataluna', 'Comunidad Valenciana', 'Extremadura', - 'Galicia', 'Madrid (Comunidad De)', 'Murcia (Region de)', - 'Navarra (Comunidad Foral De)', 'Rioja (La)') - -dataprep.out <- dataprep( - foo = basque, - predictors = c('school.illit', 'school.prim', 'school.med', - 'school.high', 'school.post.high', 'invest'), - predictors.op = 'mean', - time.predictors.prior = 1964:1969, - special.predictors = list( - list('gdpcap', 1960:1969 ,'mean'), - list('sec.agriculture', seq(1961, 1969, 2), 'mean'), - list('sec.energy', seq(1961, 1969, 2), 'mean'), - list('sec.industry', seq(1961, 1969, 2), 'mean'), - list('sec.construction', seq(1961, 1969, 2), 'mean'), - list('sec.services.venta', seq(1961, 1969, 2), 'mean'), - list('sec.services.nonventa', seq(1961, 1969, 2), 'mean'), - list('popdens', 1969, 'mean') - ), - dependent = 'gdpcap', - unit.variable = 'regionno', - unit.names.variable = 'regionname', - time.variable = 'year', - treatment.identifier = 17, - controls.identifier = control.regions, - time.optimize.ssr = 1960:1969, - time.plot = 1955:1997 -) - -synth.out <- synth( - data.prep.obj = dataprep.out, - method = 'BFGS' -) - -path.plot( - dataprep.res = dataprep.out, - synth.res = synth.out, - tr.intake = 1998 -) - -state.weights <- setNames( - control.regions, - round(synth.out$solution.w, digits = 2) -) -print(state.weights) \ No newline at end of file diff --git a/R/germany.R b/R/germany.R deleted file mode 100644 index e135dbe..0000000 --- a/R/germany.R +++ /dev/null @@ -1,72 +0,0 @@ -require(Synth) - -load('germany.rda') - -treated.countries <- 'West Germany' -control.countries <- c('USA', 'UK', 'Austria', 'Belgium', 'Denmark', 'France', - 'Italy', 'Netherlands', 'Norway', 'Switzerland', 'Japan', - 'Greece', 'Portugal', 'Spain', 'Australia', 'New Zealand' - ) - -training.dataprep.out <- dataprep( - foo = germany, - predictors = c('gdp', 'trade', 'infrate'), - special.predictors = list( - list('industry', 1971:1980, 'mean'), - list('schooling', c(1970,1975), 'mean'), - list('invest70', 1980, 'mean') - ), - dependent = 'gdp', - unit.variable = 'code', - unit.names.variable = 'country', - time.variable = 'year', - treatment.identifier = 7, - controls.identifier = control.countries, - time.predictors.prior = 1971:1980, - time.optimize.ssr = 1981:1990, - time.plot = 1960:2003 -) - -training.synth.out <- synth( - data.prep.obj = training.dataprep.out, - Margin.ipop = 0.005, - Sigf.ipop = 7, - Bound.ipop = 6 -) - -dataprep.out <- dataprep( - foo = germany, - predictors = c('gdp', 'trade', 'infrate'), - predictors.op = 'mean', - special.predictors = list( - list('industry', 1981:1990, 'mean'), - list('schooling', c(1980, 1985), 'mean'), - list('invest80', 1980, 'mean') - ), - dependent = 'gdp', - unit.variable = 'code', - unit.names.variable = 'country', - time.variable = 'year', - treatment.identifier = 7, - controls.identifier = control.countries, - time.predictors.prior = 1981:1990, - time.optimize.ssr = 1960:1989, - time.plot = 1960:2003 -) - -synth.out <- synth( - dataprep.out, - custom.v = as.numeric(training.synth.out$solution.v) -) - -path.plot( - dataprep.res = dataprep.out, - synth.res = synth.out, - tr.intake = 1990 -) - -state.weights <- setNames( - control.countries, - round(synth.out$solution.w, digits = 2) -) -print(state.weights) \ No newline at end of file diff --git a/R/germany.rda b/R/germany.rda deleted file mode 100644 index 0596308..0000000 Binary files a/R/germany.rda and /dev/null differ