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]