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
identify common ownership of shareholdersDear statalist, I have a set of data with the following variables: year, symbol (symbol of each fir…
Inconsistency between correlation analysis and regression resultsHi Statalist, I have the panel data (state-year) and run a correlations analysis between my y and x…
How to reduce empty space in the cellHi, I try to reduce or remove empty space in each cell of string variables because it really hinders…
How to draw cubic splines after Cox regressionHello, Could anybody help me with syntaxis to do this graph? y axis= hazard ratio. x axis= covariate…
Lags Leads Treatment EffectHello everyone, I unfortunately have another question! I am looking into how to adjust the regress…
Subscribe to:
Post Comments (Atom)
0 Response to summing occurrence of numeric variables
Post a Comment