Dear all,
As described in the title, I try to implement the Synthetic Control method on STATA to study generational farm transmissions between old and young farmers.
I use the SSC synth and the synth command, but it is returned : "uno() invalid -- invalid numlist has too many elements". I don't understand why.
Does someone can help me please ?
I add to this topic my STATA code, the synthetic control method is at the end :
************************************************** ************************************************** ************************************************** *************************
/* Define macros */
global varlist "idnum milex pbuce cdexe otexe extr2 regio fjuri tra05 utans utasa utato ebexp otefdd"
local y_i = 2000
local y_f = 2018
local depvar "pbuce"
/* Panel */
forvalues y = `y_i'/`y_f' {
import delimited "*********", delimiter(";")
display as text "year: " as result `y'
sort `depvar' extr2
tempfile tfile_`y'
quietly save `tfile_`y''
clear
}
clear
forvalues y = `y_i'/`y_f' {
display as text "year: " as result `y'
quietly append using `tfile_`y''
}
save panel_`y_i'_`y_f', replace
/**** Identify generation change ***/
use "********************************************* '", clear
sort idnum
xtset idnum milex, yearly
keep $varlist
generate ch2younger = (D.tra05 <= -3)
generate ch2older = (D.tra05 >= 3 & D.tra05 > .)
by idnum: egen nb_ch2younger = sum(ch2younger)
by idnum: egen nb_ch2older = sum(ch2older)
******** Gestion des données
generate transmission = (nb_ch2younger > 0 & nb_ch2older == 0)
generate generation = 1
by idnum: replace generation = 1 + sum(ch2younger)
by idnum: egen nb_annee_observation = count(idnum)
generate AvantApres = (generation > 1)
bysort idnum generation: egen nb_annee_generation = count(generation)
by idnum: egen min_nb_annee_generation = min(nb_annee_generation)
by idnum: egen nb_an_avant = count(idnum) if AvantApres == 0
by idnum: egen nb_an_apres = count(idnum) if AvantApres == 1
keep if nb_an_avant >= 5 & nb_an_apres >= 5
generate sample = (min_nb_annee_generation >= 3 & min_nb_annee_generation < .)
keep if sample == 1
generate sup1 = (cdexe == 1 | cdexe == 2 | cdexe == 3 | cdexe == 4 | cdexe == 5)
drop if sup1 == 1 /* On a viré des cdexe qui avait des pourcentages inférieurs à 1*/
generate sup2 = (fjuri == 9)
drop if sup2 == 1 /* Moins de 1% des observations */
drop if fjuri == 1 /* On en a parlé */
******** Gestion des données
drop if nb_ch2younger > 1
drop if nb_ch2older > 0
******** Synthetic control
ssc install synth
synth ebexp pbuce(2000(1)2018) cdexe(2000(1)2018) otexe(2000(1)2018) regio(2000(1)2018) fjuri(2000(1)2018) tra05(2000(1)2018), trunit(43123) trperiod(2008)
Related Posts with Problem with a synth command : error "uno() invalid -- invalid numlist has too many elements"
Unbalanced panel data - Selection problemHi everyone, I'm studying "the impact of credit access on the performance of small and medium enter…
SEM and lincom with categorical variablesHello, I collected data on BMI and social support at 3 time points (all continuous variables). I al…
Multiple observations per id, select id with highest value in other identifier and select corresponding other variables to that identifierDear statalists, I have a question with regard to organizing the data from long to wide and removin…
Data ProcessingHello Everybody , I'm a new Stata user. So, I would like to know how can I shift columns, then add…
Questions regarding multi collinearity and centering of control variableDear all, I am running a Generalized Estimating Equations model and wanted to check whether there e…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with a synth command : error "uno() invalid -- invalid numlist has too many elements"
Post a Comment