Bookmark and Share

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


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

st: Adding a suffix to variables in a local macro


From   "G. Anderson" <[email protected]>
To   [email protected]
Subject   st: Adding a suffix to variables in a local macro
Date   09 Jun 2013 17:37:49 +0100

Hi,

I have a large list of variables, from which I have created a local macro:

local commod tea coffee sugar wheat I also have variables in my data set, which refer to specific years, so I have variables tea98, coffee98, sugar98, wheat98 etc

I would like to create a local macro referring to each year, so:

local commod98 tea98 coffee98 sugar98 wheat98

local commod99 tea99 coffee99 sugar99 wheat 99

etc.

Is there a way to do this, referring to local commod and adding the the suffix "98" "99" etc?

Many Thanks,

Gareth
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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