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]
Re: st: RE: precision Problem taking string from double var
From
Maarten buis <[email protected]>
To
[email protected]
Subject
Re: st: RE: precision Problem taking string from double var
Date
Fri, 29 Oct 2010 13:41:16 +0100 (BST)
--- On Fri, 29/10/10, [email protected] wrote:
> Creating an integer var is not so good in this special case
> because these files are huge already.
A string will typically take up (much) more memory than an integer.
I proposed to use a long integer, in that case a string
varialbe has to contain for all observations a maximum of 3
characters (including the ".") for it to use less memory than
a long integer. If you can store your number as integer, i.e.
all numbers are more than -32,767 and less than 32,740, than
the string has to contain a maximum of only one character to
take up less memory. If you can store your numbers as a byte,
i.e. all numbers are more than -127 and less than 100, than
there is no string variable that takes less memory.
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* 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/