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 on April 23, and its replacement, 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 <>
To   "" <>
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   |
                              An Introduction to Stata Programming  |
   An Introduction to Modern Econometrics Using Stata  |

*   For searches and help try:

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