RosettaCodeData/Task/Map-range/Stata/map-range-2.stata
2023-07-01 13:44:08 -04: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