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]

Re: st: keeping variable labels after -collapse-


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: keeping variable labels after -collapse-
Date   Sun, 6 Jan 2013 20:44:22 +0000

No, you have not missed anything; your comment is bang on target.
Kit's suggestion is a red herring here, as I should have noticed
myself.

Nick

On Sun, Jan 6, 2013 at 5:09 PM, daniel klein <klein.daniel.81@gmail.com> wrote:
> I might be overlooking something here, but the question is/was about
> _variable_ labels, not _value_ labels. As far as I see, -label save-
> just saves and "restores" the latter. -uselabel- may be used, but it
> seems more burdensome than the few lines of code Nick suggested.
>
> Best
> Daniel
>
> --
> The FAQ concerned dates to 2002 (revised 2003): there's a simple
> question whether -label save- existed then. (I am away from my old
> manuals.)
>
> That said, the macro-based method has some uses. Kit's technique
> presupposes that the variables have the same names before and after
> -collapse-, and if that's so it solves the problem completely. But
> once you start -collapse-ing to new variable names, you will need
> something where you have more control.
>
> Nick
>
> On Sun, Jan 6, 2013 at 4:10 PM, Christopher Baum <kit.baum@bc.edu> wrote:
> [...]
>> Ingenious, but somewhat unncessary, as Stata will do this for you:
>>
>> label save using whatever.do
>> replace...
>> do whatever.do
>>
>> will restore the labels.
>>
*
*   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