When I estimate
Code:
import delim "https://raw.githubusercontent.com/SucreRouge/synth_control/master/basque.csv", clear

egen id = group(regionname)

drop if inlist(id,18)

g weight = 0

replace weight = 0.5327967 if id ==9 // catalan

replace weight = 0.0225190 if id ==13 // madrid

replace weight =  0.1151287 if id == 16 // asturias 

replace weight = 0.2892709 if id ==17 //la rioja

replace weight = . if weight ==0


drop v1

xtset id year, y

g treat = cond(id==4 & year >=1975,1,0)

cls

xtdidregress (gdpcap) (treat) [aw=weight], group(id) time(year)
Stata tells me
invalid treatment variable
Either the treatment does not vary or it is never zero. The treatment variable is either zero for
controlled observations or 1 for treated observations. To use a continuous treatment, specify (treat,
continuous) for your treatment specification.
even though this is preposterous, it's 0 for all states before 1975, 1 for the Basque Country after 1975, and 0 for all other states after 1975. However, when I estimate
Code:
import delim "https://raw.githubusercontent.com/SucreRouge/synth_control/master/basque.csv", clear

egen id = group(regionname)

drop if inlist(id,18)

g weight = 0

replace weight = 0.5327967 if id ==9 // catalan

replace weight = 0.0225190 if id ==13 // madrid

replace weight =  0.1151287 if id == 16 // asturias 

replace weight = 0.2892709 if id ==17 //la rioja

replace weight = . if weight ==0


drop v1

xtset id year, y

g treat = cond(id==4 & year >=1975,1,0)

cls

xtdidregress (gdpcap) (treat), group(id) time(year)
the error goes away and the DD estimates as we'd want it to. Why? The weights have nothing to do with the treatment variable, so it's unclear to me why use of analytic weights would affect it in one instance, but not the other.