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

st: re: double to integer


From   Dan Blanchette <[email protected]>
To   [email protected]
Subject   st: re: double to integer
Date   Thu, 7 Apr 2005 16:08:36 -0400 (EDT)

. whelp datatype

will explain data storage issues at length (so to speak).

Your variable id is likely to be an integer number but needs to be
stored using double storage type because it contains more digits
than can be accurately stored by the integer storage type.

The max number of integers that double storage type can store is 16.
Next is storage type long which can store 9 digits.  Then
storage type float can store up to 7 digits.  Storage type int is
only 4 digits.

Perhaps you are really wanting to do something else?  If you want
to find out the minimum storage length your variable id can be stored
with try -compress-

. compress id


Dan Blanchette

Applications Analyst Programmer
Carolina Population Center UNC-CH
[email protected]





------------------------------------------------------------------

st: double to integer



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index