Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Problem with minutes in egenmore


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Problem with minutes in egenmore
Date   Thu, 20 Feb 2003 09:14:03 -0000

Stephen Soldz
> 
> I'm trying to use the egenmore function, minutes, but keep 
> on getting an
> error message. I'm using version 8 and have alredy checked 
> for an update to
> egenmore.
> 
> . clear
> 
> . set obs 5
> obs was 0, now 5
> 
> . gen J="00:15"
> 
> . li J
> 
>      +-------+
>      |     J |
>      |-------|
>   1. | 00:15 |
>   2. | 00:15 |
>   3. | 00:15 |
>   4. | 00:15 |
>   5. | 00:15 |
>      +-------+
> 
> . egen Jn=seconds(J)
> problematic characters in J
> r(459);
> 
> I get the same error with  seconds:
> 
> 
> . clear
> 
> . set obs 5
> obs was 0, now 5
> 
> . gen J="01:15:15"
> 
> . li J
> 
>      +----------+
>      |        J |
>      |----------|
>   1. | 01:15:15 |
>   2. | 01:15:15 |
>   3. | 01:15:15 |
>   4. | 01:15:15 |
>   5. | 01:15:15 |
>      +----------+
> 
> . egen Jn=seconds(J)
> problematic characters in J
> r(459);
> 
> What's going on here? Am I misunderstanding something?
> 

No. This is a bug in -seconds()-. The 
test used to tap problematic input 
fails when leading zeros are present. 
For example, string(real("00")) does not 
return "0". I'll need to revise the 
test and post an update when I can. 

The same bug exists in -minutes()-, 
mentioned in Steve's title, but not in 
the body of his posting. 

Nick 
n.j.cox@durham.ac.uk 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index