大白菜2012 发表于 2012-12-9 23:55 
inrange(var,..............)
inlist(var,...........)
循着你的回复,在utilities中的[D]data management 第471页看到下面的例子:
We want to recode item by collapsing 1 and 2 into 1, 3 into 2, and 4 to 7 (boundaries included)
into 3.
. recode item (1 2 = 1) (3 = 2) (4/7 = 3), gen(Ritem)
or
. gen Ritem = item
. replace Ritem = 1 if inlist(item,1,2)
. replace Ritem = 2 if item==3
. replace Ritem = 3 if inrange(item,4,7)
多谢啦!