RosettaCodeData/Task/Map-range/Stata/map-range-2.stata
2018-06-22 20:57:24 +00:00

6 lines
155 B
Text

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