I want to develop a count variable that assesses the number of unique values across five variables: NG6, NG7, NG8, NG9, and NG10. I used tablist to get a sense for how many unique combinations I have (a total of 365!). An excerpt from that output is attached.
For the first line, I want the new count variable to assign a value of "1" (because the same value is reported: 12 and 12, and I don't care about missingness). When I code the second line, the value would be "1" (because only the value of 12 is reported, and I don't care about missingness). When I code the third line, I want the value to be "1" because the same number (12) is being reported across NG6, NG7, and NG8. For the four line, which has values of NG6 = 1 and NG7 = 12, I want the value of my new variable to be "2" because two unique values are reported. When I code the very last line shown here, the values are 3, 12, and 8, so I want the value of my new variable to be 3 to indicate 3 unique values are reported for NG6, NG7, and NG8. Help!

For the first line, I want the new count variable to assign a value of "1" (because the same value is reported: 12 and 12, and I don't care about missingness). When I code the second line, the value would be "1" (because only the value of 12 is reported, and I don't care about missingness). When I code the third line, I want the value to be "1" because the same number (12) is being reported across NG6, NG7, and NG8. For the four line, which has values of NG6 = 1 and NG7 = 12, I want the value of my new variable to be "2" because two unique values are reported. When I code the very last line shown here, the values are 3, 12, and 8, so I want the value of my new variable to be 3 to indicate 3 unique values are reported for NG6, NG7, and NG8. Help!
Comment