Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: Fwd: how to use the label of oldvar to name newvar

From   Nick Cox <>
To   "" <>
Subject   Re: st: Fwd: how to use the label of oldvar to name newvar
Date   Sun, 14 Apr 2013 14:34:20 +0100

When you say "the label" are you referring to value labels or variable labels?

Can you give an equivalent example with a dataset we can all access e.g.

sysuse auto

On 14 April 2013 14:29, anne broe <> wrote:
> 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:
> *
> *
> *
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index