Hello Ronnie.
Command "ds" will return you r(varlist). Then open a text file for
writting with "file open ... " and loop through the variables in the
list "foreach var of ..." write to the file with "file write ..."
your variable name and label. Labels are returned with
`"`: variable label `var''"'
don't forget to put these labels in quotes, and put end of line markers.
close the file after the loop with "file close".
"insheet" the resulting file
Best regards, Sergiy Radyakin
On 5/8/08, 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/