Hi,
I am using the function ‘rowtotal' to add three variable. However, I found that I can’t use ‘by’ with rowtotal. Is there any other way of adding the three variables by ArrangementNumber.
Here is what my data looks like:
I look forward to your guidance.
Best regards,
Imran Khan
I am using the function ‘rowtotal' to add three variable. However, I found that I can’t use ‘by’ with rowtotal. Is there any other way of adding the three variables by ArrangementNumber.
Code:
. egen TotalConditions = rowtotal (NumOfSB1 NumOfSB2 NumOfSB3), by (ArrangementNumber)
egen ... rowtotal() may not be combined with by
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int ArrangementNumber float(NumOfSB1 NumOfSB2 NumOfSB3) 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 117 13 0 3 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 77 4 0 0 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 84 30 0 3 end
Best regards,
Imran Khan
Comment