Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: identify all variables with dates


From   "Philip Ryan" <philip.ryan@adelaide.edu.au>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: identify all variables with dates
Date   Wed, 3 Mar 2010 12:53:09 +1030

One way is to use the  has(format <pattern>)  option  on the -ds- command.
There is an example in the help file under "advanced options".  You can
subsequently retrieve the variable names from the r(varlist) macro (do a
-return list- after the -ds- command).

Of course this method assumes you have formatted your dates appropriately.
Without formatting, to Stata a "date" is just a number with no special
properties.

Phil

Philip Ryan
University of Adelaide 


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of raoul reulen
Sent: Wednesday, 3 March 2010 11:20 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: identify all variables with dates

Hello

Is there a way to identify all variables in a dataset that contain
dates and then store the relevant variable names in a local? I am
looking for something like the "ds" command.

Thanks

Raoul
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index