synth-inference / synthdid

Synthetic difference in differences
https://synth-inference.github.io/synthdid
BSD 3-Clause "New" or "Revised" License
261 stars 96 forks source link

No Variation in Treatment Status error #120

Open MattJames242 opened 3 months ago

MattJames242 commented 3 months ago

Hi,

I have formatted my dataset so that it is in the same form as the california_99 dataset, and applied a 1 in the treated column for treated units and a 0 for all other units. However when I run 'setup = panel.matrices(GoodsExports)' it produces an error "Error in panel.matrices(GoodsExports) : There is no variation in treatment status", I was wondering how I can remedy this?

evanriehl commented 3 months ago

Try this: setup = panel.matrices(as.data.frame(GoodsExports))

See here for details: https://github.com/synth-inference/synthdid/issues/75