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: date("01jan1960", "DMY") does not seem to work with -if- qualifier of the command -tablist-
From
Jeremy Page <[email protected]>
To
[email protected]
Subject
st: date("01jan1960", "DMY") does not seem to work with -if- qualifier of the command -tablist-
Date
Mon, 21 Mar 2011 20:22:31 -0400
I am a frequent user of the user generated command -tablist- and I
have run into a behavior that I can not explain. I am trying to use
Stata's -date- command with the -if- qualifier to restrict
observations from displaying in -tablist-. When I attempt to do this
there appears to be a problem. I am able to use the -date- command to
restrict observations with -tabulate- and I am able to restrict
observations in -tablist- with a local variable being defined by the
-date- command but not with -tablist-. It is my understanding that
the -if- qualifiers across all programs should act the same. Am I
missing something? I have included an example below using a Stata
supplied data set.
I am using version 1.2 of -tablist- which can be found at -findit
tablist- and my version of Stata is 10.1 on a Windows XP machine.
Thank you for your help.
Best,
Jeremy
**********begin example***************
clear
use http://www.stata-press.com/data/r10/datexmpl.dta
gen statadate = date(bday, "DMY")
format statadate %td
list statadate
display date("01Jan1960", "DMY")
***it works with tabulate
tab bday name if statadate > date("01Jan1960", "DMY")
***it works with a local variable
local dte = date("01Jan1960", "DMY")
tablist bday name if statadate > `dte'
***it does not work with tablist
tablist bday name if statadate > date("01Jan1960", "DMY")
************end example***************
*
* 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/