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]

Re: st: keeping variable labels after -collapse-

From   "Roger B. Newson" <>
Subject   Re: st: keeping variable labels after -collapse-
Date   Mon, 07 Jan 2013 19:57:47 +0000

Yes, -descsave- can do this (with a -do()- option), if the output variable has the same name as the input variable. In the examples quoted, however, there are prefixes and suffixes, so we have to do some additional looping.

I hope this helps.

Best wishes


Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Web page:
Departmental Web page:

Opinions expressed are those of the author, not of the institution.

On 07/01/2013 17:49, David Radwin wrote:
Can't this be done with Roger Newson's -descsave- (SSC)?

David Radwin
Senior Research Associate
MPR Associates, Inc.
2150 Shattuck Ave., Suite 800
Berkeley, CA 94704
Phone: 510-849-4942
Fax: 510-849-0794

-----Original Message-----
From: [mailto:owner-] On Behalf Of daniel klein
Sent: Sunday, January 06, 2013 9:34 AM
Subject: Re: st: keeping variable labels after -collapse-

I did indeed overlook something, as -uselabel- will not help here,
either. Seems there is no canned way to save variable labels.


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.


*   For searches and help try:

*   For searches and help try:

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