Hello,

I have 10 numeric variables: offense1-offense10. Each one can take a specific value of between 1 and 700. I want to create 5 variables that sums the total of 5 specific numeric observations across all 10 of the offense variables.
For example, if offense1, offense2, and offense8=20, I want to create a new variable indicating that the value 20 occurred 3 times. Obviously egen rowtotal would give me the value 60, but I'm looking for occurrences, not totals.

Thanks!