В настоящее время я пытаюсь выполнить метод управления Syntheti c с помощью пакета synth в R. Однако, когда я пытаюсь запустить команду dataprep, я получаю ошибку, описанную в заголовке.
Это мой код:
dataprep.out.MEX <- dataprep(
foo = ppcommon,
predictors = c("lnPop", "lnGDP", "landlocked", "colonizer1"),
predictors.op = "mean",
time.predictors.prior = 1986:1993,
special.predictors = list(
list("lnTradePC", 1986:1993 , "mean")),
dependent = "lnTradePC",
unit.variable = "ID",
unit.names.variable = "CountryCode",
time.variable = "Year",
treatment.identifier = 55,
controls.identifier = c(1:54, 56:88),
time.optimize.ssr = 1986:1992,
time.plot = 1986:2014
)
Я проверил dimnames и dim моего фрейма данных, и они кажутся одинаковыми:
dimnames(ppcommon)
[[1]]
[1] "6-1986" "6-1987" "6-1988" "6-1989" "6-1990" "6-1991" "6-1992"
[8] "6-1993" "6-1994" "6-1995" "6-1996" "6-1997" "6-1998" "6-1999"
[15] "6-2000" "6-2001" "6-2002" "6-2003" "6-2004" "6-2005" "6-2006"
[22] "6-2007" "6-2008" "6-2009" "6-2010" "6-2011" "6-2012" "6-2013"
[29] "6-2014" "9-1986" "9-1987" "9-1988" "9-1989" "9-1990" "9-1991"
[36] "9-1992" "9-1993" "9-1994" "9-1995" "9-1996" "9-1997" "9-1998"
[43] "9-1999" "9-2000" "9-2001" "9-2002" "9-2003" "9-2004" "9-2005"
[50] "9-2006" "9-2007" "9-2008" "9-2009" "9-2010" "9-2011" "9-2012"
[57] "9-2013" "9-2014" "10-1986" "10-1987" "10-1988" "10-1989" "10-1990"
[64] "10-1991" "10-1992" "10-1993" "10-1994" "10-1995" "10-1996" "10-1997"
[71] "10-1998" "10-1999" "10-2000" "10-2001" "10-2002" "10-2003" "10-2004"
[78] "10-2005" "10-2006" "10-2007" "10-2008" "10-2009" "10-2010" "10-2011"
[85] "10-2012" "10-2013" "10-2014" "13-1986" "13-1987" "13-1988" "13-1989"
[92] "13-1990" "13-1991" "13-1992" "13-1993" "13-1994" "13-1995" "13-1996"
[99] "13-1997" "13-1998" "13-1999" "13-2000" "13-2001" "13-2002" "13-2003"
[106] "13-2004" "13-2005" "13-2006" "13-2007" "13-2008" "13-2009" "13-2010"
[113] "13-2011" "13-2012" "13-2013" "13-2014" "14-1986" "14-1987" "14-1988"
[120] "14-1989" "14-1990" "14-1991" "14-1992" "14-1993" "14-1994" "14-1995"
[127] "14-1996" "14-1997" "14-1998" "14-1999" "14-2000" "14-2001" "14-2002"
[134] "14-2003" "14-2004" "14-2005" "14-2006" "14-2007" "14-2008" "14-2009"
[141] "14-2010" "14-2011" "14-2012" "14-2013" "14-2014" "15-1986" "15-1987"
[148] "15-1988" "15-1989" "15-1990" "15-1991" "15-1992" "15-1993" "15-1994"
[155] "15-1995" "15-1996" "15-1997" "15-1998" "15-1999" "15-2000" "15-2001"
[162] "15-2002" "15-2003" "15-2004" "15-2005" "15-2006" "15-2007" "15-2008"
[169] "15-2009" "15-2010" "15-2011" "15-2012" "15-2013" "15-2014" "16-1986"
[176] "16-1987" "16-1988" "16-1989" "16-1990" "16-1991" "16-1992" "16-1993"
[183] "16-1994" "16-1995" "16-1996" "16-1997" "16-1998" "16-1999" "16-2000"
[190] "16-2001" "16-2002" "16-2003" "16-2004" "16-2005" "16-2006" "16-2007"
[197] "16-2008" "16-2009" "16-2010" "16-2011" "16-2012" "16-2013" "16-2014"
[204] "17-1986" "17-1987" "17-1988" "17-1989" "17-1990" "17-1991" "17-1992"
[211] "17-1993" "17-1994" "17-1995" "17-1996" "17-1997" "17-1998" "17-1999"
[218] "17-2000" "17-2001" "17-2002" "17-2003" "17-2004" "17-2005" "17-2006"
[225] "17-2007" "17-2008" "17-2009" "17-2010" "17-2011" "17-2012" "17-2013"
[232] "17-2014" "22-1986" "22-1987" "22-1988" "22-1989" "22-1990" "22-1991"
[239] "22-1992" "22-1993" "22-1994" "22-1995" "22-1996" "22-1997" "22-1998"
[246] "22-1999" "22-2000" "22-2001" "22-2002" "22-2003" "22-2004" "22-2005"
[253] "22-2006" "22-2007" "22-2008" "22-2009" "22-2010" "22-2011" "22-2012"
[260] "22-2013" "22-2014" "24-1986" "24-1987" "24-1988" "24-1989" "24-1990"
[267] "24-1991" "24-1992" "24-1993" "24-1994" "24-1995" "24-1996" "24-1997"
[274] "24-1998" "24-1999" "24-2000" "24-2001" "24-2002" "24-2003" "24-2004"
[281] "24-2005" "24-2006" "24-2007" "24-2008" "24-2009" "24-2010" "24-2011"
[288] "24-2012" "24-2013" "24-2014" "25-1986" "25-1987" "25-1988" "25-1989"
[295] "25-1990" "25-1991" "25-1992" "25-1993" "25-1994" "25-1995" "25-1996"
[302] "25-1997" "25-1998" "25-1999" "25-2000" "25-2001" "25-2002" "25-2003"
[309] "25-2004" "25-2005" "25-2006" "25-2007" "25-2008" "25-2009" "25-2010"
[316] "25-2011" "25-2012" "25-2013" "25-2014" "29-1986" "29-1987" "29-1988"
[323] "29-1989" "29-1990" "29-1991" "29-1992" "29-1993" "29-1994" "29-1995"
[330] "29-1996" "29-1997" "29-1998" "29-1999" "29-2000" "29-2001" "29-2002"
[337] "29-2003" "29-2004" "29-2005" "29-2006" "29-2007" "29-2008" "29-2009"
[344] "29-2010" "29-2011" "29-2012" "29-2013" "29-2014" "31-1986" "31-1987"
[351] "31-1988" "31-1989" "31-1990" "31-1991" "31-1992" "31-1993" "31-1994"
[358] "31-1995" "31-1996" "31-1997" "31-1998" "31-1999" "31-2000" "31-2001"
[365] "31-2002" "31-2003" "31-2004" "31-2005" "31-2006" "31-2007" "31-2008"
[372] "31-2009" "31-2010" "31-2011" "31-2012" "31-2013" "31-2014" "32-1986"
[379] "32-1987" "32-1988" "32-1989" "32-1990" "32-1991" "32-1992" "32-1993"
[386] "32-1994" "32-1995" "32-1996" "32-1997" "32-1998" "32-1999" "32-2000"
[393] "32-2001" "32-2002" "32-2003" "32-2004" "32-2005" "32-2006" "32-2007"
[400] "32-2008" "32-2009" "32-2010" "32-2011" "32-2012" "32-2013" "32-2014"
[407] "33-1986" "33-1987" "33-1988" "33-1989" "33-1990" "33-1991" "33-1992"
[414] "33-1993" "33-1994" "33-1995" "33-1996" "33-1997" "33-1998" "33-1999"
[421] "33-2000" "33-2001" "33-2002" "33-2003" "33-2004" "33-2005" "33-2006"
[428] "33-2007" "33-2008" "33-2009" "33-2010" "33-2011" "33-2012" "33-2013"
[435] "33-2014" "36-1986" "36-1987" "36-1988" "36-1989" "36-1990" "36-1991"
[442] "36-1992" "36-1993" "36-1994" "36-1995" "36-1996" "36-1997" "36-1998"
[449] "36-1999" "36-2000" "36-2001" "36-2002" "36-2003" "36-2004" "36-2005"
[456] "36-2006" "36-2007" "36-2008" "36-2009" "36-2010" "36-2011" "36-2012"
[463] "36-2013" "36-2014" "37-1986" "37-1987" "37-1988" "37-1989" "37-1990"
[470] "37-1991" "37-1992" "37-1993" "37-1994" "37-1995" "37-1996" "37-1997"
[477] "37-1998" "37-1999" "37-2000" "37-2001" "37-2002" "37-2003" "37-2004"
[484] "37-2005" "37-2006" "37-2007" "37-2008" "37-2009" "37-2010" "37-2011"
[491] "37-2012" "37-2013" "37-2014" "38-1986" "38-1987" "38-1988" "38-1989"
[498] "38-1990" "38-1991" "38-1992" "38-1993" "38-1994" "38-1995" "38-1996"
[505] "38-1997" "38-1998" "38-1999" "38-2000" "38-2001" "38-2002" "38-2003"
[512] "38-2004" "38-2005" "38-2006" "38-2007" "38-2008" "38-2009" "38-2010"
[519] "38-2011" "38-2012" "38-2013" "38-2014" "39-1986" "39-1987" "39-1988"
[526] "39-1989" "39-1990" "39-1991" "39-1992" "39-1993" "39-1994" "39-1995"
[533] "39-1996" "39-1997" "39-1998" "39-1999" "39-2000" "39-2001" "39-2002"
[540] "39-2003" "39-2004" "39-2005" "39-2006" "39-2007" "39-2008" "39-2009"
[547] "39-2010" "39-2011" "39-2012" "39-2013" "39-2014" "41-1986" "41-1987"
[554] "41-1988" "41-1989" "41-1990" "41-1991" "41-1992" "41-1993" "41-1994"
[561] "41-1995" "41-1996" "41-1997" "41-1998" "41-1999" "41-2000" "41-2001"
[568] "41-2002" "41-2003" "41-2004" "41-2005" "41-2006" "41-2007" "41-2008"
[575] "41-2009" "41-2010" "41-2011" "41-2012" "41-2013" "41-2014" "42-1986"
[582] "42-1987" "42-1988" "42-1989" "42-1990" "42-1991" "42-1992" "42-1993"
[589] "42-1994" "42-1995" "42-1996" "42-1997" "42-1998" "42-1999" "42-2000"
[596] "42-2001" "42-2002" "42-2003" "42-2004" "42-2005" "42-2006" "42-2007"
[603] "42-2008" "42-2009" "42-2010" "42-2011" "42-2012" "42-2013" "42-2014"
[610] "43-1986" "43-1987" "43-1988" "43-1989" "43-1990" "43-1991" "43-1992"
[617] "43-1993" "43-1994" "43-1995" "43-1996" "43-1997" "43-1998" "43-1999"
[624] "43-2000" "43-2001" "43-2002" "43-2003" "43-2004" "43-2005" "43-2006"
[631] "43-2007" "43-2008" "43-2009" "43-2010" "43-2011" "43-2012" "43-2013"
[638] "43-2014" "45-1986" "45-1987" "45-1988" "45-1989" "45-1990" "45-1991"
[645] "45-1992" "45-1993" "45-1994" "45-1995" "45-1996" "45-1997" "45-1998"
[652] "45-1999" "45-2000" "45-2001" "45-2002" "45-2003" "45-2004" "45-2005"
[659] "45-2006" "45-2007" "45-2008" "45-2009" "45-2010" "45-2011" "45-2012"
[666] "45-2013" "45-2014" "47-1986" "47-1987" "47-1988" "47-1989" "47-1990"
[673] "47-1991" "47-1992" "47-1993" "47-1994" "47-1995" "47-1996" "47-1997"
[680] "47-1998" "47-1999" "47-2000" "47-2001" "47-2002" "47-2003" "47-2004"
[687] "47-2005" "47-2006" "47-2007" "47-2008" "47-2009" "47-2010" "47-2011"
[694] "47-2012" "47-2013" "47-2014" "48-1986" "48-1987" "48-1988" "48-1989"
[701] "48-1990" "48-1991" "48-1992" "48-1993" "48-1994" "48-1995" "48-1996"
[708] "48-1997" "48-1998" "48-1999" "48-2000" "48-2001" "48-2002" "48-2003"
[715] "48-2004" "48-2005" "48-2006" "48-2007" "48-2008" "48-2009" "48-2010"
[722] "48-2011" "48-2012" "48-2013" "48-2014" "49-1986" "49-1987" "49-1988"
[729] "49-1989" "49-1990" "49-1991" "49-1992" "49-1993" "49-1994" "49-1995"
[736] "49-1996" "49-1997" "49-1998" "49-1999" "49-2000" "49-2001" "49-2002"
[743] "49-2003" "49-2004" "49-2005" "49-2006" "49-2007" "49-2008" "49-2009"
[750] "49-2010" "49-2011" "49-2012" "49-2013" "49-2014" "50-1986" "50-1987"
[757] "50-1988" "50-1989" "50-1990" "50-1991" "50-1992" "50-1993" "50-1994"
[764] "50-1995" "50-1996" "50-1997" "50-1998" "50-1999" "50-2000" "50-2001"
[771] "50-2002" "50-2003" "50-2004" "50-2005" "50-2006" "50-2007" "50-2008"
[778] "50-2009" "50-2010" "50-2011" "50-2012" "50-2013" "50-2014" "51-1986"
[785] "51-1987" "51-1988" "51-1989" "51-1990" "51-1991" "51-1992" "51-1993"
[792] "51-1994" "51-1995" "51-1996" "51-1997" "51-1998" "51-1999" "51-2000"
[799] "51-2001" "51-2002" "51-2003" "51-2004" "51-2005" "51-2006" "51-2007"
[806] "51-2008" "51-2009" "51-2010" "51-2011" "51-2012" "51-2013" "51-2014"
[813] "53-1986" "53-1987" "53-1988" "53-1989" "53-1990" "53-1991" "53-1992"
[820] "53-1993" "53-1994" "53-1995" "53-1996" "53-1997" "53-1998" "53-1999"
[827] "53-2000" "53-2001" "53-2002" "53-2003" "53-2004" "53-2005" "53-2006"
[834] "53-2007" "53-2008" "53-2009" "53-2010" "53-2011" "53-2012" "53-2013"
[841] "53-2014" "55-1986" "55-1987" "55-1988" "55-1989" "55-1990" "55-1991"
[848] "55-1992" "55-1993" "55-1994" "55-1995" "55-1996" "55-1997" "55-1998"
[855] "55-1999" "55-2000" "55-2001" "55-2002" "55-2003" "55-2004" "55-2005"
[862] "55-2006" "55-2007" "55-2008" "55-2009" "55-2010" "55-2011" "55-2012"
[869] "55-2013" "55-2014" "56-1986" "56-1987" "56-1988" "56-1989" "56-1990"
[876] "56-1991" "56-1992" "56-1993" "56-1994" "56-1995" "56-1996" "56-1997"
[883] "56-1998" "56-1999" "56-2000" "56-2001" "56-2002" "56-2003" "56-2004"
[890] "56-2005" "56-2006" "56-2007" "56-2008" "56-2009" "56-2010" "56-2011"
[897] "56-2012" "56-2013" "56-2014" "59-1986" "59-1987" "59-1988" "59-1989"
[904] "59-1990" "59-1991" "59-1992" "59-1993" "59-1994" "59-1995" "59-1996"
[911] "59-1997" "59-1998" "59-1999" "59-2000" "59-2001" "59-2002" "59-2003"
[918] "59-2004" "59-2005" "59-2006" "59-2007" "59-2008" "59-2009" "59-2010"
[925] "59-2011" "59-2012" "59-2013" "59-2014" "60-1986" "60-1987" "60-1988"
[932] "60-1989" "60-1990" "60-1991" "60-1992" "60-1993" "60-1994" "60-1995"
[939] "60-1996" "60-1997" "60-1998" "60-1999" "60-2000" "60-2001" "60-2002"
[946] "60-2003" "60-2004" "60-2005" "60-2006" "60-2007" "60-2008" "60-2009"
[953] "60-2010" "60-2011" "60-2012" "60-2013" "60-2014" "67-1986" "67-1987"
[960] "67-1988" "67-1989" "67-1990" "67-1991" "67-1992" "67-1993" "67-1994"
[967] "67-1995" "67-1996" "67-1997" "67-1998" "67-1999" "67-2000" "67-2001"
[974] "67-2002" "67-2003" "67-2004" "67-2005" "67-2006" "67-2007" "67-2008"
[981] "67-2009" "67-2010" "67-2011" "67-2012" "67-2013" "67-2014" "70-1986"
[988] "70-1987" "70-1988" "70-1989" "70-1990" "70-1991" "70-1992" "70-1993"
[995] "70-1994" "70-1995" "70-1996" "70-1997" "70-1998" "70-1999"
[ reached getOption("max.print") -- omitted 1552 entries ]
[[2]]
[1] "CountryCode" "Country.Name" "Year" "GDPPC"
[5] "Population" "lnGDP" "Imports" "Exports"
[9] "Land.Area" "Malaria.Incidence" "Trade_total" "TradePC"
[13] "landlocked" "colonizer1" "ID" "lnTradePC"
[17] "lnPop" "lnGDPPC"
> dim(ppcommon)
[1] 2552 18
Если я запускаю traceback , мне выдается следующее сообщение, которое я не могу расшифровать:
> traceback()
3: `rownames<-`(`*tmp*`, value = foo.object[intersect(special.units.tr,
special.times), time.var])
2: spec.pred.func(list.object = special.predictors[[i]], tr.numb = treatment.identifier,
co.numb = controls.identifier, unit.var = unit.variable,
time.var = time.variable, foo.object = foo, X0.inner = X0,
X1.inner = X1)
1: dataprep(foo = ppcommon, predictors = c("lnPop", "lnGDP"), predictors.op = "mean",
time.predictors.prior = 1986:1993, special.predictors = list(list("lnTradePC",
1986:1993, "mean")), dependent = "lnTradePC", unit.variable = "ID",
unit.names.variable = "CountryCode", time.variable = "Year",
treatment.identifier = 55, controls.identifier = c(1:54,
56:88), time.optimize.ssr = 1986:1992, time.plot = 1986:2014)
Может ли кто-нибудь помочь мне определить причину этой ошибки и найти решение?
Большое спасибо!