Statalist


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

st: AW: RE: AW: AW: AW: AW: Error in egen rank(), unique?


From   "Kaulisch, Marc" <[email protected]>
To   <[email protected]>
Subject   st: AW: RE: AW: AW: AW: AW: Error in egen rank(), unique?
Date   Tue, 3 Nov 2009 18:22:08 +0100

My apologies.
Indeed the replace command as I constructed it is/was the mistake.

To your earlier post:
To 2.1/2.2 I agree that rank ignores missings and that it should be.


Marc

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] Im Auftrag von Nick Cox
Gesendet: Dienstag, 3. November 2009 18:05
An: [email protected]
Betreff: st: RE: AW: AW: AW: AW: Error in egen rank(), unique?

This is the same problem as bit you last time. See my earlier post. 

You are overwriting the results of -egen, rank()- with your own -replace-. You are responsible for this, not -egen-. 

Nick
[email protected] 

Kaulisch, Marc

I see the problem or a counter-intuitive result as follows:
The egen rank(), unique gives the following ranks:
1 2 3 3
If the sequence is 2007m8 2008m5 . 2009m3

In my opinion it is counter-intuitive because
1) I understand unique as giving not identical ranks - but it does if a missing is inserted
2) I would think that a rank command sorts the values in the var on its own and does not need help to perform this


*
*   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/

*
*   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