1

我目前正在分析税收对一个国家的机构的影响。我正在使用合成对照方法来确定对玻利维亚的治疗效果。synth() 命令工作正常,安慰剂(国家 8 = 不丹而不是国家 9 = 玻利维亚)却没有。它会生成重复的错误消息:

solve.default(AP, c(cx, cy)) 中的错误:系统在计算上是奇异的:倒数条件数 = 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") 
4

0 回答 0