Hello All,

I am trying to create a synthetic control group using Stata's 'synth' package but when I enter the code:

tsset GeoFips Year

synth Ethanol_cap21 GDPcap(1970(1)1979) Population_age21 Alcohol_CPI Ethanol_cap21(1979) Ethanol_cap21(1970) Ethanol_cap21(1975), trunit(3) trperiod(1980)

I get the following error:

treated unit not found in panelvar - check tr()

After some research, I am aware that this issue is due to my panelvar GeoFips not taking values 1 - x. I confirmed this using the levelsof command and got the following:

levelsof GeoFips
0 1000 2000 4000 5000 6000 8000 9000 10000 11000 12000 13000 15000 16000 17000 18000 19000 20000 21000 22000 23000 24000 25000 26000 27000 28000 29000 30000 310
> 00 32000 34000 35000 36000 37000 38000 39000 40000 41000 42000 44000 45000 46000 47000 48000 49000 50000 51000 53000 54000 55000 56000.

Can anyone provide some insight on how to recode this variable so that it takes values 1,2,3, etc?

Thanks