I have a dataset which ranks occupations by a given characteristic. In this list of occupations, some are tied on this characteristic and therefore have the same rank position. However, I have external data that allows me to break these ties for each pair of occupations within a tied rank.
The data currently look like this:
The occupation and rank variables should be self-explanatory. 'pair' is a concatenated string variable indicating a 'pair' of occupations that share the same rank. 'win' indicates the winner of the pairwise contrast indicated by 'pair'.
You can see that:
- CEO and medical doctor are tied for rank 1, but the 'pair' and 'win' columns show that when they are matched against each other, 'medical doctor' wins.
- PR exec, Vet, priest, and physicist are tied for rank 3, but the pairwise contrasts indicate that PR executive->priest->physicist->vet (assuming transitivity)
I would like to end up with a dataset that looks like the following - i.e. with the rank ties broken using the data from the pair and win variables:
Can anyone help?
The data currently look like this:
occupation | rank | pair | win |
Company CEO | 1 | Medical doctorCompany CEO | Medical doctor |
Medical doctor | 1 | ||
Company senior executive | 2 | ||
PR executive | 3 | PR executivePriest | PR executive |
Veterinarian | 3 | PhysicistVeterinarian | Physicist |
Priest | 3 | PriestPhysicist | Priest |
Physicist | 3 | PR executiveVeterinarian | PR executive |
The occupation and rank variables should be self-explanatory. 'pair' is a concatenated string variable indicating a 'pair' of occupations that share the same rank. 'win' indicates the winner of the pairwise contrast indicated by 'pair'.
You can see that:
- CEO and medical doctor are tied for rank 1, but the 'pair' and 'win' columns show that when they are matched against each other, 'medical doctor' wins.
- PR exec, Vet, priest, and physicist are tied for rank 3, but the pairwise contrasts indicate that PR executive->priest->physicist->vet (assuming transitivity)
I would like to end up with a dataset that looks like the following - i.e. with the rank ties broken using the data from the pair and win variables:
occupation | rank |
Company CEO | 2 |
Medical doctor | 1 |
Company senior executive | 3 |
PR executive | 4 |
Veterinarian | 7 |
Priest | 5 |
Physicist | 6 |
Can anyone help?
Comment