Hi all,

I am trying to alternate position label (pos=6 and pos=12) in a scatter graph, for this purpose I am trying to generate sequencial dicotomic variable.

For this purpose I am using labvposition package.

Code example:

Code:
sysuse auto,clear
collapse mpg, by(rep78)
drop if missing(rep78)

*Here I generate sequencial dicotomic variable:

gen pos = 6
replace pos = 12 if pos in 1/1
replace pos = 12 if pos in 3/3
replace pos = 12 if pos in 5/5

scatter  mpg rep78, ///
    c(l) sort mlabel(mpg) mlabv(pos)
Array
Array




Do you know other method to generate this sequencial dicotomic variable for 1000 obs?
Thanks in advance
Rodrigo