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

st: Re: List of variables


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: List of variables
Date   Mon, 6 Dec 2004 08:39:10 -0500

I wrote an ado to do something similar -- search all .ado files (on the adopath) for certain comment lines with keywords to create autodocumenting ados with a keyword index. I sent a working but rough version to another Statalister in May04 and they produced something more sophisticated and I believe said that they would send it to SSC but I don't seem to be able to find it now using search...If you can't track it down, I can send you my original ado offlist.

Michael Blasnik
[email protected]


----- Original Message ----- From: "Fred Wolfe" <[email protected]>
To: <[email protected]>
Sent: Monday, December 06, 2004 5:13 AM
Subject: st: List of variables



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

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