我已经声明了一个本地宏,它对应于我的 Stata 项目中的几个变量名:
local letters a b c d
我希望能够使用宏中的所有变量生成一个新变量letters
:
gen highest_letter = max(`letters')
但是,这不起作用,并导致以下错误消息:
a b c d not found
这是因为max()
要求输入用逗号分隔,例如:
gen highest_letter = max(a, b, c, d)
我有什么办法可以操纵宏letters
吗?
或者使用除 之外的函数max()
,这样我就可以在变量列表中找到最大值而无需手动将它们输入max()
函数?