These 6 variable have values between -1 and 4.
I want varNEW to be, for each observation, the count of "1" in the 6 other variables for this observation. How could I get to that? I'm guessing with a combination of count and if but I am struggling to get it to work.
Just beginning with Stata, sorry for such a basic question. I didn't find an answer already, even though I'm sure it must be somewhere obvious...
Thanks in advance for the help

0 Response to Generating new var conditional on other variables
Post a Comment