taoqq 发表于 2012-10-16 21:19 
嗯,你的意思我明白,我就是觉得这样很慢的样子,想知道有没有更好的方法呢
如果你是收集整理第二手数据的话,没有你想象的那么难。
比方说,有四个省分别上交了自己的数据,包括4个变量,year, province, county, and gdp in a excel file。不要担心变量的顺序,只要确认数据包里的变量名和其他数据包的是一致。
each row , (i.e., observation), represents a county in a spesific year.
you don't need to do anything in excel.
you can use stata to read excel files one by one and append all together. then, sort them to get a neat table/data
//read excel fileinsheet
xml
odbc
//append alluse data1, clear
append using data2
append using data3
append using data4
//变量值排序
sort year province county
//变量排序
order year province county gdp