Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: sort by permutation


From   Abdel Rahmen El Lahga <[email protected]>
To   [email protected]
Subject   st: sort by permutation
Date   Mon, 21 Dec 2009 00:34:17 +0100

I have a sample of N individuals belonging to 4 sub-groups g1, g2, g3,
g4. I would like to sort my sample of size N  in 24 different
manners, corresponding to all possible permutations of my group
variable
say, {g1,g2,g3,g4}, {g1,g3,g2,g4} {g1,g3,g4,g2}...etc.
Taking a simple exemple for N=10. I have
id group
1    1
2    1
3    2
4    2
5    2
6    3
7    3
8    4
9    4
10  4

one possible sorting among 24 could be
id group
1    1
2    1
6    3
7    3
3    2
4    2
5    2
8    4
9    4
10  4
any help is apreciated
-- 
AbdelRahmen El Lahga
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index