[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Errors in egen, total()

From   Dan Blanchette <>
Subject   Re: st: Errors in egen, total()
Date   Sun, 13 Dec 2009 16:03:08 -0500 (EST)

floats have about 7 digits of accuracy so I think that's what
you're running into with rev = 28536717

Here's the documentation on data types:

 . recast long rev

as long has up to 9 digits of accuracy.

Dan Blanchette
Research Associate
Center for Entrepreneurship and Innovation
Duke University's Fuqua School of Business


Date: Sat, 12 Dec 2009 22:19:30 -0600
From: "Mike Kim" <>
Subject: st: Errors in egen, total()

Hello all,

I used "egen total()" to create "cumrev" like the following, but if there is only one week per title, total gives a slightly lower number than the original number in some cases (1 or 2 lower). Any idea about why it produces different numbers?

bys title week: egen cumrev=total(rev)

title   week    rev                 cumrev
A       707     28536717     28536716
A       708     10                   30
A       708     20                   30
B        801    .....

Thank you,
*   For searches and help try:

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