我目前正在分析税收对一个国家的制度的影响。我正在使用合成控制方法来确定对玻利维亚的治疗效果。 synth()命令工作正常,安慰剂(国家8 =不丹而不是国家9 =玻利维亚)确实没有。它会生成重复的错误消息:
solve.default(AP,c(c.x,c.y))出错: 系统在计算上是单数的:倒数条件数= 9.90619e-17
我附上了代码。您可以在以下链接下找到数据集: totalB-Dataset
我无法弄清楚为什么第一个synth()命令可以正常工作,而只有不同国家的命令才能正常工作。我尝试过使用更大的公差。另外,我运行了回归并且没有检测到那里的奇点。
我非常感谢任何帮助!
创建矩阵以为synth()
提供输入 dataprep.out <-
dataprep(foo = totalB,
predictors = c("vdem_corr",
"fh_ipolity2",
"TotTax",
"TotRev") ,
predictors.op = "mean" ,
time.predictors.prior = 1990:1998 ,
special.predictors = list(
list("gle_rgdpc" , 1990:1998 , "mean"),
list("wdi_educ" , seq(1990,1998,2), "mean"),
list("gle_pop", seq(1990,1998,2), "mean"),
list("wdi_urb" , seq(1990,1998,2), "mean"),
list("wdi_popdens", 1998, "mean"),
list("wdi_land", 1998, "mean"),
list("conflict", 1998, "mean")
),
dependent = "political_abs",
unit.variable = "countryID",
unit.names.variable = "country",
time.variable = "year",
treatment.identifier = 9,
controls.identifier = c(1:8,10:74),
time.optimize.ssr = 1990:1998,
time.plot = 1990:2010
)
synth.out <- synth(data.prep.obj = dataprep.out,
method = "BFGS")
现在安慰剂测试:
dataprep.out <-
dataprep(foo = totalB,
predictors = c("vdem_corr",
"fh_ipolity2",
"TotTax",
"TotRev") ,
predictors.op = "mean" ,
time.predictors.prior = 1990:1998 ,
special.predictors = list(
list("gle_rgdpc" , 1990:1998 , "mean"),
list("wdi_educ" , seq(1990,1998,2), "mean"),
list("gle_pop", seq(1990,1998,2), "mean"),
list("wdi_urb" , seq(1990,1998,2), "mean"),
list("wdi_popdens", 1998, "mean"),
list("wdi_land", 1998, "mean"),
list("conflict", 1998, "mean")
),
dependent = "political_abs",
unit.variable = "countryID",
unit.names.variable = "country",
time.variable = "year",
treatment.identifier = 8,
controls.identifier = c(1:7,9:74),
time.optimize.ssr = 1990:1998,
time.plot = 1990:2010
)
synth.out <- synth(data.prep.obj = dataprep.out,
method = "BFGS")