On Tue, 13 Mar 2012, Sven Schreiber wrote:
Redefine the variable?
Which is something you can do in (at least) two ways:
<hansl>
nulldata 100
old = ceil(6*uniform())
# now we want to swap 1 and 4
# more virtuosistic
new = (old == 4) ? 1 : ((old==1) ? 4 : old)
xtab old new
# more flexible
a = seq(1,6)
b = {4,2,3,1,5,6}
new = replace(old,a,b)
xtab old new
</hansl>
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti