Let's say I have two variables "score" and "rank." I would like "rank" to be a rank of each score allowing for ties. That is, if a tie occurs, each "score" should receive the same rank and the forthcoming rank should "skip" ahead by the number of ties that preceded it (see below for an example).
I have tried using the egen function with the rank option, but I could not get it to produce what I would like.
I have tried using the egen function with the rank option, but I could not get it to produce what I would like.
| Score | Rank |
| 20 | 1 |
| 21 | 2 |
| 22 | 3 |
| 22 | 3 |
| 23 | 5 |
| 24 | 6 |
| 24 | 6 |

Comment