Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Create dataset of variable names and variable labels


From   Ronnie Babigumira <[email protected]>
To   [email protected]
Subject   Re: st: Create dataset of variable names and variable labels
Date   Thu, 08 May 2008 23:05:04 +0200

Thanks to everyone who responded. Martin, you were correct, I meant labels.

I decided to use -descsave- because of a very useful variable it creates called order which I use later.

descsave `vars', saving(`desc_labels', replace) rename(name Variable) keep(Variable varlab order)

Ronnie


Austin Nichols wrote:
Ronnie Babigumira <[email protected]>:
Try:

sysuse auto
ssc inst descsave
descsave, sa(test)  keep(name varlab)
use test
li

On Thu, May 8, 2008 at 12:25 PM, Ronnie Babigumira <[email protected]> wrote:
Dear List
How can I create a small data set made up of variable names and variable
levels for some variables in a data set.

Something like this from the auto data

variable        var_label
make            Make and Model
price           Price
mpg             Mileage (mpg)
length          Length (in.)
trunk           Trunk space (cu. ft.)

Ronnie
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index