stata 發芽_1121b_30

myrj發表於2024-11-21
cap:mkdir 1121b
//發芽_1121b_30
import excel "D:\Stata17\1121b\2.各省份綠色金融指數(2000年-2022年).xlsx", sheet("Sheet1") firstrow clear
rename(省份 年份)(sheng year)
replace sheng=subinstr(sheng,"","",.)
replace sheng=subinstr(sheng,"","",.)
replace sheng=subinstr(sheng,"自治區","",.)
replace sheng=subinstr(sheng,"回族","",.)
replace sheng=subinstr(sheng,"維吾爾","",.)
replace sheng=subinstr(sheng,"壯族","",.)
duplicates drop sheng year,force
save 1121b\shu1,replace

import excel "D:\Stata17\1121b\二版)01-22就業人數.xlsx", sheet("Sheet1") firstrow clear
rename id sheng
drop if sheng==""
replace sheng=subinstr(sheng,"","",.)
replace sheng=subinstr(sheng,"","",.)
replace sheng=subinstr(sheng,"自治區","",.)
replace sheng=subinstr(sheng,"回族","",.)
replace sheng=subinstr(sheng,"維吾爾","",.)
replace sheng=subinstr(sheng,"壯族","",.)
duplicates drop sheng year,force
save 1121b\shu2,replace


import excel "D:\Stata17\1121b\農業經濟韌性.xlsx", sheet("Sheet1") firstrow clear
rename(地區 年份)(sheng year)
drop if sheng==""
replace sheng=subinstr(sheng,"","",.)
replace sheng=subinstr(sheng,"","",.)
replace sheng=subinstr(sheng,"自治區","",.)
replace sheng=subinstr(sheng,"回族","",.)
replace sheng=subinstr(sheng,"維吾爾","",.)
replace sheng=subinstr(sheng,"壯族","",.)
duplicates drop sheng year,force
save 1121b\shu3,replace

import excel "D:\Stata17\1121b\農業新質生產力原始資料.xlsx", sheet("Sheet1") firstrow clear
drop in 1
rename(地區 年份)(sheng year)
destring year,force replace
drop if sheng==""
replace sheng=subinstr(sheng,"","",.)
replace sheng=subinstr(sheng,"","",.)
replace sheng=subinstr(sheng,"自治區","",.)
replace sheng=subinstr(sheng,"回族","",.)
replace sheng=subinstr(sheng,"維吾爾","",.)
replace sheng=subinstr(sheng,"壯族","",.)
duplicates drop sheng year,force
save 1121b\shu4,replace

use 1121b\shu1,clear
forvalues ii=2/4{
    merge 1:1 sheng year using 1121b\shu`ii'
    keep if _merge==3
    drop _merge
}
save 1121b\jieguo1,replace
tostring _all,replace force
do "C:\Users\ADMINI~1\AppData\Local\Temp\STDcc8_000000.tmp"

相關文章