Hello, I'm having issues with the following.

I have 4 variables x1, x2, x3, x4 each one with 10 observations

I need to create a variable new_variable = x1+x2+x3+x4 with help of foreach command. I know it is straightforward using gen new_variable = x1+x2+x3+x4 but I can't achieve it using foreach.

Thanks