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]

Re: st: dates in the 'if' condition


From   Christopher Baum <kit.baum@bc.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: dates in the 'if' condition
Date   Wed, 10 Aug 2011 09:20:29 -0400

<>
On Aug 10, 2011, at 2:33 AM, Tomas wrote:

> I have not used Stata in time-series context before and would like to ask
> a rather simple thing. Having the time variable in a %tq format, it displays the date label but the underlying value
> is a number. I have tried to condition with the `if' statement referring to the label instead of the underlying value, but to no avail. Is there any way to do so?
> Here is an example:
>              storage  display     value
> variable name   type   format      label      variable label
> - --------------------------------------------------------------------------------------------------------------------------------------
> time          float  %tq              

If time is the variable by which the data are tsset,

keep if tin(1997q4, 1997q4)

should work fine.

Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
                              An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
   An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html




*
*   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