How to find the highest rated item within a set of questions
For this worked example, we are using data from a tracking study on cola consumption habits. We have consumption data on six types of colas — Coca-Cola, Diet Coke, Coke Zero, etc — and we want to determine the most-consumed beverage for each survey respondent.
You can replicate this example by downloading the QPack and running through each step in Q.
The above code does the following:
- Line 1 creates an array of the variables we want to analyze.
- Line 2 finds the largest of the given values.
- Line 3 locates the position of the largest value.
Step 3: Change the question type of the new variable
In the Variables and Questions tab, change the Question Type to Pick One. This will allow you to analyze the question as a categorical variable rather than a numeric variable.