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
Related Posts with How to change the 'levelsof' a panel variable?
Bootstrapping to obtain confidence intervals around differences in failure functionsI have a longitudinal dataset with 2 matched cohorts (Cohort==1 & Cohort==0) in a ratio of 1:3 t…
Issues with converting string to numerical or date in StataHi everyone, I am a new comer to Stata. Currently, I have issues with converting some imported dat…
How to get the number of digits correct using esttabDear StataList, when I run the code below, I almost get what I want. The only problem is that the n…
Not achieving convergence in Latent Class AnalysisHi all, I'm exploring an LCA model with a household survey we've ran. This is looking at the activi…
Creating polynomial expansion of a variableDear Statalist, What I want to do is to create a polynomial expansion of a certain degree of two va…
Subscribe to:
Post Comments (Atom)
0 Response to How to change the 'levelsof' a panel variable?
Post a Comment