In Stata columns are always called variables.
This surely is prominent in all introductory
literature on Stata.
Not only do I not know of such a command, but
the existence of such a command strikes me
as utterly unlikely.
I am prepared to be embarrassed by a counter-example,
but my reasoning is as follows.
This would require a Stata program to be written
that scanned through a
do file in advance of it being executed, to
check for
0. variable names being used implicitly
1. variable names being used explicitly
2. wildcarded variable names.
Those variable names might occur in lots
of places, not only immediately following
a command name, or a command and subcommand
name, but also within -if- conditions,
within option names, etc., etc.
What is more, a do file might in principle
call other do files, so they would need to
be scanned too.
I doubt if this is a complete catalogue
of the potential difficulties.
I'd guess rather that your professor is
confused or misinformed, or that what
you seek is not what you ask for here.
Nick
[email protected]
Adrian Yung Hwei Ow
> I'm new to the list, and I had a short question about STATA commands.
>
> I'm working for a professor who's trying to clean up her dataset; she
> told me that there was a command in STATA that automatically kept only
> the data columns used to produce result (more precisely, a
> command that
> allows one to automatically drop columns not used for a given do file)
> -- do you know what this might be?
*
* 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/