cd "D:\SUNBOW"
forv i=2001/2014 {
clear
? ? insheet using `i'indegree.csv
? ? save `i'indegree.dta, replace
}
***append
clear
use 2000indegree.dta, clear
forv i=2001/2014 {
? ? append using `i'indegree.dta
}
save indegree2000-2014.dta, replace
***merge
***merge前對(duì)變量名重命名
clear
use 2000indegree.dta, clear
rename x indegree2000
save 2000indegree.dta,replace
clear
forv i=2001/2014 {
? ? use `i'indegree.dta
rename x indegree`i'
save `i'indegree.dta,replace
}
***merge
clear
use 2000indegree.dta, clear
forv i=2001/2014 {
? ? merge 1:1 v1 using `i'indegree.dta
drop _merge
}
save 2000-2014indegreemerged.dta, replace