Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: loop with global marco

From   Nick Bornschein <>
To   "" <>
Subject   st: loop with global marco
Date   Wed, 19 Feb 2014 13:23:29 +0100


I defined 3 global macros, each of them containing the names of variables: (... means there are a lot more variables in it)

global var1 "hope truth..."
global var2 "life death..."
global var3 "never loose..."

Now I want to summarize the global macros in blocks with:

foreach x of global var1 var2 var3 {
su `x'

But it does not work, it always runs through all variables without creating blocks. What is the problem?

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index