I am working with a dataset from a poll of registered voters. For each observation (one voter), respondents were asked to use "feeling thermometers" to indicate their attitudes towards a series of different candidates. Each feeling thermometer variable is coded as a numeric variable with an integer value of 1, 2, 3, or 4. I am looking for a way to create an indicator variable for each observation to denote which feeling thermometer variable has the highest value (in order to eventually determine a correlation between positive attitudes and voting behavior). I haven't been able to figure out how to create such an indicator variable with the limited Stata knowledge I currently have. I have tried using the rowsort command and generating new variables, which is close to what I want to do, but I don't simply want the numeric values of the variables; rather, I want to identify which variable has that maximum value. Advice appreciated!
-
Login or Register
- Log in with
Comment