RosettaCodeData/Task/Map-range/Stata/map-range-2.stata

7 lines
155 B
Plaintext

clear
set obs 11
gen x=_n-1
maprange x if mod(x,2)==0, gen(y) from(0 10) to(-10 10)
maprange x if mod(x,2)!=0, gen(y) from(0 10) to(-100 100) replace
list