Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: RE: identify all variables with dates


From   "Philip Ryan" <[email protected]>
To   <[email protected]>
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: [email protected]
[mailto:[email protected]] On Behalf Of raoul reulen
Sent: Wednesday, 3 March 2010 11:20 AM
To: [email protected]
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index