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

st: RE: describe

From   "Fred Wolfe" <>
To   <>
Subject   st: RE: describe
Date   Fri, 12 Sep 2003 09:20:06 -0500

-----Original Message-----
From:	David Kantor []
Sent:	Fri 9/12/2003 8:45 AM
Subject:	st: describe
Hi everyone.

I've noticed a certain restriction in -describe-, which presented a bit of 
a problem.  I think I found a solution, but I just thought I'd ask for 
opinions from the rest of you.

If I do
  des var using file1

and var is an abbreviation (not the full name) for a variable in file1, 
then the command fails. (var does not end with an asterisk.)

But if I -use- file1 and then,
  des var

it works fine.

Is there a way to check that a variable exists in a file that is not 
currently loaded, where the name might possibly be abbreviated? -- without 
loading that file?

My solution is to append an asterisk on var:
  des var* using file1

Thus it succeeds if var is a legitimate abbreviation for at least one 
variable in file1, which may be a bit imprecise, but good enough for what 
I'm doing.

Any other suggestions?  And has anyone else find this limitation of 
-describe- to be a problem?

Yes, it is a problem. However, one work around is 

qui des  using file1, varlist

this puts the variable names in   r(varlist)  where they can be searched, You could then identify if the variable was present and do des again.



© Copyright 1996–2022 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index