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]

Re: st: dates in the 'if' condition


From   Christopher Baum <[email protected]>
To   "[email protected]" <[email protected]>
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index