Hi, I am running the following package from SSC.

Code:
sort year country
by year country : duncan occupation gender
The results are saved in r()

Code:
return list

scalars:
                  r(c) =  25
                  r(N) =  2228

matrices:
                  r(D) :  2 x 2
How can i save the indices stored as a new variable?

I am calculating occupational sex segregation, by survey year and country.