Help with Synth package

Hello all,

I am currently trying to produce a synthetic control for a project that I am working on. A little background, the treatment event started in 2011 in the state of Georgia. I have data going back from 2001 to 2020 including all 50 states. I am trying to figure out why I am getting the following error:

Error in dataprep(foo = MasterSheet, predictors = c("Education", "Employment", :
n duplicate unit.variable.names across units

My setup is as follows:

library(Synth)
dataprep.out<- dataprep( foo = MasterSheet, 
          predictors = c("Education", "Employment", "INcome", "Binge_drinkers",
                         "Heavy_drinkers", "Age_group"), 
          predictors.op = "mean", 
          dependent = "Days_perweek", 
          unit.variable = "State", 
          time.variable = "Year", 
          treatment.identifier = 13, 
          controls.identifier = c(2, 4:6, 8, 9, 10, 12, 16:33, 35:42, 44:46, 
                                  48:51, 53:56), 
          time.predictors.prior = c(2001:2010), 
          time.optimize.ssr = c(2001:2011), 
          unit.names.variable = "State_name", 
          time.plot = 2001:2020)

Where State_name is "Georgia", State = FIPS code. I understand the n duplicate names, however, isn't that the point? It is panel data??

Thanks in advance

"INcome"

Hi. Is the 'N' an issue?

Can you provide a reproducible example of MasterSheet?

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.