0

I am trying to run the Synthetic Control Method in R. I tried to prepare my data according to Abadie, Diamond and Hainmueller (2011) (https://www.jstatsoft.org/article/view/v042i13). But when running the dataprep.out function I get the error message that my unit.variables are not nurmeric variables in foo. I don't understand the problem here because my table purely consists of numeric values. The table is also classified as a data.frame. I have attached some pictures to underline my problem. If anyone could help me that would be greatly appreciated!

My code (https://i.stack.imgur.com/7BVYc.png) My table (https://i.stack.imgur.com/TV1IC.png)

I have tried to reimport my data over and over again. But nothing seems to help.

1 Answers1

0

I had the same problem, and following the solution by Nick Bombaij in Another question for Synth dataprep() Error unit.variable not found as numeric variable in foo worked for me. That is using the as.data.frame command to transform my data to be in the class of data.frame only. Then class(data) should gives answer "data.frame" instead of "tbl_df" "tbl" "data.frame"

wfywillow
  • 1
  • 1