[DDI-SRG] long and short integers
I-Lin Kuo
ikuoikuo at gmail.com
Wed Aug 1 16:26:57 EDT 2007
it's here
http://www.stata.com/help.cgi?datatypes
On 8/1/07, Wendy Thomas <wlt at pop.umn.edu> wrote:
>
>
> This is interesting because the default value for integers is generally 8
> or 9 digits which makes it long by defination. In fact provided a width,
> the only time there can be a question is when it is a 5 digit number, in
> which case I need to know if its greater or less than 32767. Just seems a
> bit odd is all. Can you check and see what STATA identifies as "long"?
> Just curious.
>
> Wendy
>
>
> On Wed, 1 Aug 2007, I-Lin Kuo wrote:
>
> > stata identifies byte, int, long. Other stat packages probably infer
> this
> > from the data.
> >
> > The specification of the data type as int or long can affect whether the
> > dataset actually fits into memory or crashes with an out-of-memory error
> > when you try to do a calculation with it. It probably also affects the
> speed
> > of the calculations.
> >
> > I don't think that in this case, the data itself really cares though.
> >
> > On 8/1/07, Wendy Thomas <wlt at pop.umn.edu> wrote:
> >>
> >>
> >> Data types in SPSS
> >>
> >> Numeric (width, decimal places)
> >> Comma
> >> Dot
> >> Scientific notation
> >> Date (with a whole range of format options)
> >> Dollar (with laoyout options)
> >> Custom currency
> >> String
> >>
> >>
> >> We may be moving into the world of overkill. As for allocating space,
> all
> >> these stats packages are space hogs. The read in the whole data set
> store
> >> all outputs and processes add filter variables and maintain a log. I
> don't
> >> think this is a function of long vs short integers
> >>
> >> Wendy
> >>
> >>
> >> On Wed, 1 Aug 2007, Wendy Thomas wrote:
> >>
> >>>
> >>> but one can set max length. Does STATA actually ask for identification
> >> of
> >>> longInteger shortInteger. All the statistical software I've worked
> with
> >>> stops at identifying integers. Actually its Numeric, length, number of
> >>> decimals. If not declared SPSS sets a default of 8 characters with 2
> >>> decimals.
> >>>
> >>> Wendy
> >>>
> >>>
> >>> On Wed, 1 Aug 2007, I-Lin Kuo wrote:
> >>>
> >>>> It makes a difference if you're writing stata code:
> >>>>
> >>>> http://www.stata.com/help.cgi?datatypes
> >>>>
> >>>> According to that page, it conserves memory, which is important when
> >> working
> >>>> with large datasets. My wife uses stata, and sometimes she has to
> >> explicitly
> >>>> allocate more memory to stata because, I'm guessing, stata keeps the
> >> entire
> >>>> dataset in memory while working. I don't know how SAS or SPSS are
> >> affected,
> >>>> though.
> >>>>
> >>>> On 8/1/07, Wendy Thomas <wlt at pop.umn.edu> wrote:
> >>>>>
> >>>>> so the only difference between a long integer and a short integer is
> >> that
> >>>>> that short is limited to +32767 to -32768 where as a long can be
> >>>>> +922337236854775807 to -922337236854775808. In either case I can
> >> define
> >>>>> the total digits. Basically the rule is "if it ain't short its
> long"?
> >> and
> >>>>> if I want to be safe I just declare everything to be long so that I
> >> don't
> >>>>> have to check the ranges of 5 digit numbers.
> >>>>>
> >>>>> Tell me this distinction has some value in the world of processing
> >> social
> >>>>> science data. I can see identifying an integer, but is this
> >> necessary????
> >>>>>
> >>>>> Wendy
> >>>>>
> >>>>> Wendy L. Thomas Phone: +1 612.624.4389
> >>>>> Data Access Core Director Fax: +1 612.626.8375
> >>>>> Minnesota Population Center Email: wlt at pop.umn.edu
> >>>>> University of Minnesota
> >>>>> 50 Willey Hall
> >>>>> 225 19th Avenue South
> >>>>> Minneapolis, MN 55455
> >>>>>
> >>>>> _______________________________________________
> >>>>> DDI-SRG mailing list
> >>>>> DDI-SRG at icpsr.umich.edu
> >>>>> http://www.icpsr.umich.edu/mailman/listinfo/ddi-srg
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> I-Lin Kuo
> >>>>
> >>>
> >>> Wendy L. Thomas Phone: +1 612.624.4389
> >>> Data Access Core Director Fax: +1 612.626.8375
> >>> Minnesota Population Center Email: wlt at pop.umn.edu
> >>> University of Minnesota
> >>> 50 Willey Hall
> >>> 225 19th Avenue South
> >>> Minneapolis, MN 55455
> >>> _______________________________________________
> >>> DDI-SRG mailing list
> >>> DDI-SRG at icpsr.umich.edu
> >>> http://www.icpsr.umich.edu/mailman/listinfo/ddi-srg
> >>>
> >>
> >> Wendy L. Thomas Phone: +1 612.624.4389
> >> Data Access Core Director Fax: +1 612.626.8375
> >> Minnesota Population Center Email: wlt at pop.umn.edu
> >> University of Minnesota
> >> 50 Willey Hall
> >> 225 19th Avenue South
> >> Minneapolis, MN 55455
> >>
> >
> >
> >
> > --
> > I-Lin Kuo
> >
>
> Wendy L. Thomas Phone: +1 612.624.4389
> Data Access Core Director Fax: +1 612.626.8375
> Minnesota Population Center Email: wlt at pop.umn.edu
> University of Minnesota
> 50 Willey Hall
> 225 19th Avenue South
> Minneapolis, MN 55455
>
--
I-Lin Kuo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.icpsr.umich.edu/pipermail/ddi-srg/attachments/20070801/fd90cbf8/attachment.html
More information about the DDI-SRG
mailing list