Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: List of variables


From   Fred Wolfe <[email protected]>
To   <[email protected]>
Subject   st: List of variables
Date   Mon, 06 Dec 2004 04:13:12 -0600

Hi,

I am interested in compiling a searchable list of variables that we use in our research.

Our first approach is to use, sequentially, all of our Stata files and extract the variable names, paths and labels. We save this into a single file of 8871 variables (varfile.dta) and search it with Stata. This works quite well.

However, this does not identify variables that are newly produced as the result of running Stata programs but are never saved in data sets. I would like to identify these ~1500 variables.

I can do this with the -textpad- editor by searching in the personal ado directory for -lab var- and -label variable-. The output can be manipulated, and after a number of steps I can manually produce a supplemental .dta file containing information.

It would be better if this could be done automatically within Stata. I have thought that a list of files could be produced in Stata. Then one could use the -file- program, and each ado file (there are 590 personal ado files) could be searched and the new variables extracted. This is a lot of programming, and before I start on something like this, I wonder if anyone on the list has a program or pieces of code that could accomplish this task.

As a corollary, it is difficult to search for personal ado files in Stata, compared with the ease of searching with Stata's -search- facility. We have tried to do this by placing lines like this in our programs:

*! keywords: duration elapsed time

and then searching with an external search program (dtsearch). It works pretty well, but is not generalizeable beyond individual users. I wonder if anyone has come up with a solution for this problem.

Thanks,

Fred




Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel (316) 263-2125 Fax (316) 263-0761
[email protected]


*
* 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