The questionnaire I have data from asked respondents to rank 20 items on a scale of importance to them. The lower end of the scale contained a "bin" in which respondents could throw away any of the 20 items that they found completely unimportant to them. The result is a dataset with 20 variables (1 for every item). Every variable receives a number between 1 and 100 (and 0 if the item was thrown in the bin)
I would like to recode the entries into a ranking of the variables for every respondent. So all variables would receive a number between 1 and 20 relative to where that respondent ranked it.
Example:
Current:
What I would like:
As you can see with respondent2, I would like items that tie to get the same rank and the ranking to then skip a number.
I have found a lot of info on how to rank observations but I have not found out how to rank variables yet. Is there anyone that knows how to do this? I think there should be something like an egen command but I can only find the version for ranking observations.
I would like to recode the entries into a ranking of the variables for every respondent. So all variables would receive a number between 1 and 20 relative to where that respondent ranked it.
Example:
Current:
item1 | item2 | item3 | item4 | item5 | item6 | item7 | item8 | etc. | |
respondent1 | 67 | 44 | 29 | 7 | 0 | 99 | 35 | 22 | |
respondent2 | 0 | 42 | 69 | 50 | 12 | 0 | 67 | 100 | |
etc. |
What I would like:
item1 | item2 | item3 | item4 | item5 | item6 | item7 | item8 | etc. | |
respondent17 | 7 | 6 | 4 | 2 | 1 | 8 | 5 | 3 | |
respondent2 | 1 | 4 | 7 | 5 | 3 | 1 | 6 | 8 | |
etc. |
As you can see with respondent2, I would like items that tie to get the same rank and the ranking to then skip a number.
I have found a lot of info on how to rank observations but I have not found out how to rank variables yet. Is there anyone that knows how to do this? I think there should be something like an egen command but I can only find the version for ranking observations.
Comment