zdlspace 发表于 2020-12-31 11:30 
global
请问levelsof只能运行一次,我的stata整体没关;但是重新打开use dta表,再运行命令(调用levelsof 后),就使用不了了,如下。第一次运行可以,再运行一次就没变化了:
use city, clear
levelsof city, local(city) // Restore city names in a local macro named city
gen city1 = ""
foreach c of local city {
replace city1 = "`c'" if strmatch(firm, "*`c'*")
}
原文链接https://bbs.pinggu.org/thread-5778694-1-1.html
请问如何可以反复调用呢,谢谢!