hello eyeryone,
i merged a few data sets from EuropeanSocial Survey.
I allready created a numeric country variable:
generate country_id=.
replace country_id = 1 if cntry == "BE"
replace country_id = 2 if cntry == "CH"
replace country_id = 3 if cntry == "DE"
replace country_id = 4 if cntry == "DK"
replace country_id = 5 if cntry == "ES"
replace country_id = 6 if cntry == "FI"
replace country_id = 7 if cntry == "FR"
replace country_id = 8 if cntry == "GB"
replace country_id = 9 if cntry == "IE"
replace country_id = 10 if cntry == "NL"
replace country_id = 11 if cntry == "NO"
replace country_id = 12 if cntry == "PT"
replace country_id = 13 if cntry == "SE"
now i need to declare a time series structure which sorts my cases by wave (Year of Survey) and country. I tried it like this but it did not work:
sort country_id wave
by wave: gen time_country_id = _n
tsset country_id time_country_id
i hope that someone can help me!
thanks a lot in advance!!
Simon
i merged a few data sets from EuropeanSocial Survey.
I allready created a numeric country variable:
generate country_id=.
replace country_id = 1 if cntry == "BE"
replace country_id = 2 if cntry == "CH"
replace country_id = 3 if cntry == "DE"
replace country_id = 4 if cntry == "DK"
replace country_id = 5 if cntry == "ES"
replace country_id = 6 if cntry == "FI"
replace country_id = 7 if cntry == "FR"
replace country_id = 8 if cntry == "GB"
replace country_id = 9 if cntry == "IE"
replace country_id = 10 if cntry == "NL"
replace country_id = 11 if cntry == "NO"
replace country_id = 12 if cntry == "PT"
replace country_id = 13 if cntry == "SE"
now i need to declare a time series structure which sorts my cases by wave (Year of Survey) and country. I tried it like this but it did not work:
sort country_id wave
by wave: gen time_country_id = _n
tsset country_id time_country_id
i hope that someone can help me!
thanks a lot in advance!!
Simon

Comment