Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: getting around tsset time variable integer restriction -Work with minutes???


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: getting around tsset time variable integer restriction -Work with minutes???
Date   Tue, 7 Feb 2006 21:51:55 -0600

Though -tsset- requires integer values, the time variable does not have to
be stored as an integer.

For example:

. set obs 1000000
obs was 0, now 1000000

. gen time = _n

. tsset time
        time variable:  time, 1 to 1000000

. desc

Contains data
  obs:     1,000,000                          
 vars:             1                          
 size:     8,000,000 (74.6% of memory free)
----------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
----------------------------------------------------------------------------
time            float  %9.0g                  
----------------------------------------------------------------------------
Sorted by:  time


One possibility would be to create a new time variable:

sort time
gen mytime = _n
tsset mytime


Hope this helps,
Scott


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Zachary Byron Singer
> Sent: Tuesday, February 07, 2006 9:23 PM
> To: [email protected]
> Subject: Re: st: RE: getting around tsset time variable integer
> restriction -Work with minutes???
> 
> The problem is not the units, it is the length of the series.  My series
> has over 149,000 observations and tsset wants the time variable stored as
> an integer, which limits me to a maximum of 65,000 observations since
> integers cannot be smaller than -32767 or greater than 32740.  Simply
> converting half hours to minutes doesn't solve the problem.  I need a way
> to store my time variable as a long.
> 
> Zach
> 


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index