I am currently writing a research project on the effects of voting behaviour after the closure of mines in a given area. For this research I have chosen the 'synthetic control' method. Now, I have run into trouble with the synth package, namely, each time that I try to dataprep the data to create the synthetic control unit I get error messages. These messages show the the following:
"Your panel, as described by unit.variable and time.variable, is unbalanced. Balance it and run again."
I have currently modelled my data after the Abadie's dataset used in his study on terrorism in the Basque region. And I ought to note that there is no missing data in my dataset, nor are there outliers.
I have tried to make several changes to my code, however, each time I try this, I run into trouble. Moreover, I have tried copying code from others who came up with a solution, but this did not work either. I would be very very thankful if someone could help me with my problem.
Some other lovely person has helped me with my previous problem, for which I am very grateful. However, being new to coding, I do not really have any idea as to how to solve my problem.
enter code here {dataprep_outcomes <- dataprep(foo=dataset [dataset$Year %in% c(1948:1986),],
predictors = c("Income","Distance","Gini","Percentage_voted","Protest"),
dependent = c("Percentage_voted"),
unit.variable = c("Municipality_No"),
time.variable = c("Year"),
treatment.identifier = 1,
controls.identifier = c(2:14),
time.predictors.prior = intersect(1948:1965, dataset$Year),
time.optimize.ssr = intersect(1948:1986, dataset$Year),
unit.names.variable = c("Municipality_ID"),
time.plot = intersect("1948:1986"), dataset$Year)}
I would like to run my dataprep. If one has suggestions regarding the manner in which I can alter my data, that would be welcome as well!
Thank you in advance.