STATA 遍历查找

ssc install elabel ,replace
sysuse auto,clear
use d:\statashu\2\cgss2015,clear
foreach v of varlist _all{
    cap:sdecode `v',replace
}
use cgss2015-2,replace
local k=_N
foreach var of varlist _all{
    local a:var label `var'
//     disp "`a'"
    forvalues i=1/`k'{
        cap:if ustrpos(`var'[`i'],"山东")>0{
            disp `var'
            break
        }
        
    }
}

 

posted @ 2023-04-18 09:38  myrj  阅读(24)  评论(0编辑  收藏  举报