Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Joseph Coveney" <jcoveney@bigplanet.com> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: best practice for dates and times |
Date | Tue, 22 Feb 2011 00:39:07 +0900 |
Junlin Liao wrote: . . . I thought -clock- or -Clock- would be smart enough to figure it out by itself. . . . I think there again is a chance for Stata to get smart. -------------------------------------------------------------------------------- I'm inclined to agree with Junlin on this. The user has to supply a mask for the date-time data as the second argument. It seems to me that the function should be able to determine from that information whether double-precision is needed, whether single-precision will be adequate, and even when integer will suffice. Stata is not entirely consistent in automatically detecting and setting the proper storage type. For example, back on the earlier thread, typing -generate y = 83085733- won't set the data type to the necessary precision, but opening the data editor and pasting 83085733 into the first cell and closing *does* set the data type to long. And, typing -generate float y = 1- and then -replace y = 83085733- won't automatically promote the data type to accommodate the larger value. On the other hand, first entering -generate byte y = 1- and then -replace y = 83085733- does. Joseph Coveney * * 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/