Dear Statalisters,
All my .dta files (one per country) are stored in the same folder. I am using this command to append them all:
But once I have my appended dataset, the variable that is supposed to denote the region of the surveyed individual gets label from the first dataset, i.e. the first country. Please have a look at my data:
As you can see, a2 have labels from regions that are located in Albania, however 12 is the country code for a country that isn't Albania. I suspect this is due to the option "force", but if I do not write it, I get an error message saying that my variables do not have the same format across datasets. Do I have to manually format every single variable? What should I do to have an appended dataset that displays the appropriate label?
All my .dta files (one per country) are stored in the same folder. I am using this command to append them all:
Code:
cd "$input" local append: dir "." files "*.dta" *log using session1 *precombine `append' // precombine is from SSC *log close append using `append', force
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int a1 float a2 12 2 12 2 12 1 12 1 12 1 12 1 12 2 12 1 12 1 12 1 12 2 12 1 12 2 12 1 12 1 12 1 12 2 12 2 12 1 12 1 end label values a1 A1 label values a2 a2 label def a2 1 "Tirana", modify label def a2 2 "Durres and Shkoder", modify

Comment