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!
Related Posts with summing occurrence of numeric variables
Reshape using j varname string as variable name outputHi Statalists! Currently I am trying to reshape daily returns data for S&P500 listed companies …
Export misstable to LatexHi, What options are available for exporting Stata's misstable to Latex? This was asked six years …
QP/LM not found in xtqptestDear all, I'm trying to apply the "xtqptest" by Born and Breitung in my Panel Data analysis. As sug…
Analyzing Multi response questionHi All, I am a beginner STATA user and I need help to solve the challenge I face: I have an example…
scatterplot with text labels for y and x?Dear All, I'd like to have a figure like below (need not to be exactly the same). Array I make up …
Subscribe to:
Post Comments (Atom)
0 Response to summing occurrence of numeric variables
Post a Comment