I have this data
RES RANK1 RANK2 RANK3 RANK4 RANK5
1 3 3 5 16 1
2 3 1 2 5 16
3 3 5 15 10 1
how do i melt the data such that values of RANK1 to RANK5 becomes the variable and RANK1 to RANK5 becomes the value.
The data were gathered by: among the list of (22) items, select the top 5 preferences.
The new data would be analyze as if the answers are multi response.
expected output would be (eg.RES=1)
RES 1 2 3 5 10 15 16
1 RANK5 RANK2 RANK3 RANK4
2 RANK2 RANK3 RANK1 RANK4 RANK5
3 RANK5 RANK1 RANK2 RANK4 RANK3
Thanks!