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
Related Posts with Adding columns with loop
count the number of distinct observations across variablesHello Stata folks, I am working on a dataset that each school ID has 7 years of data capturing princ…
Rounding, multiple decimals off and LocalsI have been trying to get the round function to feed some locals that I use to create graphs labels,…
Error updating somersd; perhaps due to general update problem?I'm unable to use the cendif command within the somersd package. The error I get is identical to tha…
Problems with spmapGood afternoon, the comment is new with the generation of database in STATA. OBJECTIVE: GENERATE MAP…
GraphHello, any guidance or where to start if I want to build a graph similar to this one? Thanks …
Subscribe to:
Post Comments (Atom)
0 Response to Adding columns with loop
Post a Comment