Hello, I am trying to generate a new variable (let's call it varNEW) based on 6 other variables (let's call them var1, var2, var3, var4, var5, var6).

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