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: Fwd: how to use the label of oldvar to name newvar
From
anne broe <[email protected]>
To
[email protected]
Subject
st: Fwd: how to use the label of oldvar to name newvar
Date
Sun, 14 Apr 2013 14:29:50 +0100
Dear all
I am encoding a string var atc to a numeric var n_atc to enable the
use of forvalues.
In each loop i generate a newvar called atc_`xx' if atc== `xx' and
collapse (sum) of this variable.
My problem however that instead of atc_`xx' I would like the variable
to be named after the original string var atc which equals the label
of n_atc.
Is there anyway you can use the `xx' to identify to variable and then
name it after the label?
Hope someone can help me
Thanks
Anne
*
* 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/