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)
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.
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.
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)
0 Response to Incorrect Stata Error Message for xtdidregress
Post a Comment