Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
x1 = uniqrows(X)
Then, the matrix given is:
x1 = (
1,0,0,0,0,0,0,0\
1,0,0,0,1,0,0,0\
1,0,0,1,0,0,0,0\
1,0,1,0,0,0,0,0\
1,1,0,0,0,0,0,0\
1,1,0,0,1,0,0,1\
1,1,0,1,0,0,1,0\
1,1,1,0,0,1,0,0 )
But what I need is:
x2 = (
1,0,0,0,0,0,0,0\
1,0,1,0,0,0,0,0\
1,0,0,1,0,0,0,0\
1,0,0,0,1,0,0,0\
1,1,0,0,0,0,0,0\
1,1,1,0,0,1,0,0\
1,1,0,1,0,0,1,0\
1,1,0,0,1,0,0,1 )
Of course, this can be done easily for just this matrix, but the problem is that
I need the correct matrix as part of an estimation command (thus, the matrices
can be different everytime, dependent on the dataset at hand), so I need a sort
of general way to ensure the matrix is always sorted correctly. However, I've
not find a working strategy yet.
Kind regards, Alex
*
* 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/