Hello!
I want to create a new variable that sums all of this dummy variables
They are simple dummy variables that take the value of 1 if "yes" and 0 otherwise.
The code I wrote to achieve my goal was:
Nevertheless the new variable "sumsupp" is giving me values from 0-8 instead of being a dummy variable (1 or 0) or is it ok the way I´m doing?
Thank you! Have a great year!
I want to create a new variable that sums all of this dummy variables
Code:
Rsuppdoc Rsuppleg Rsuppjob Rsuppaprt Rsupphealth Rsuppeduc Rsuppeduc2 RsuppAT Rsuppfood Rsupppsyc
The code I wrote to achieve my goal was:
Code:
egen sumsupp = rowtotal(Rsuppdoc Rsuppleg Rsuppjob Rsuppaprt Rsupphealth Rsuppeduc Rsuppeduc2 RsuppAT Rsuppfood Rsupppsyc)
Code:
tab sumsupp sumsupp | Freq. Percent Cum. ------------+----------------------------------- 0 | 459 56.04 56.04 1 | 174 21.25 77.29 2 | 81 9.89 87.18 3 | 52 6.35 93.53 4 | 29 3.54 97.07 5 | 16 1.95 99.02 6 | 6 0.73 99.76 7 | 1 0.12 99.88 8 | 1 0.12 100.00 ------------+----------------------------------- Total | 819 100.00
Comment