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
Scatterplots with weighted marker size revisitedHello everybody, this is not strictly a technical question, but more one about how to find an appro…
Interaction term omitted due to collinearityVersion: Stata 16 Dear Statalisters, I have difficulties with testing my interaction term in a fix…
How to find controls in cross sectional dataHello I am working on a cross sectional data (Demographic Health Survey data), in the data-set ther…
GSEM with "observed" but "treated-as-latent" variablesDear all, I am trying to model the causal effects of R&D on innovation output and of innovation…
Assign (A,B) and (B,A) to the same group?Dear all, I have a data handling question which should be basic but for which I don't figure out th…
Subscribe to:
Post Comments (Atom)
0 Response to summing occurrence of numeric variables
Post a Comment