I have a data set which as variables based on yes/no questions. I have recoded all the variables (9 total) so that the yes answer is 1 and the no is 0. Now I want to make a new variable=1 in which 1 is every individual whose sum of the 9 dummy variables is >=5.
gen F_ACTIVIST_W127=1 if total (NEW_SM10_a_W127, NEW_SM10_b_W127, NEW_SM10_c_W127, NEW_SM10_d_W127, NEW_SM10_e_W127, NEW_SMBLM_a_W127, NEW_SMBLM_b_W127, NEW_SMBLM_c_W127, NEW_SMBLM_d_W127)>=5
this is the code that I tried that didn't work.
gen F_ACTIVIST_W127=1 if total (NEW_SM10_a_W127, NEW_SM10_b_W127, NEW_SM10_c_W127, NEW_SM10_d_W127, NEW_SM10_e_W127, NEW_SMBLM_a_W127, NEW_SMBLM_b_W127, NEW_SMBLM_c_W127, NEW_SMBLM_d_W127)>=5
this is the code that I tried that didn't work.
Comment