Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73268

Counting How Many Unique Responses are in a Set of Variables in Stata

$
0
0
I have a data set with variables topicname1-topicname10. I would like to create a variable that gives me a count of the number of unique topics each respondent has within those sets of variables without counting missing responses and only counting each topic name once. I want to do this because sometimes topic names repeat, for example topicname1 can be books but then topicname5 can also be books, but in that instance I only want books to be counted once. I have tried multiple ways to do this including turning the wide data set long but no luck, was wondering if anyone knew a good strategy.

Viewing all articles
Browse latest Browse all 73268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>