Statalist The Stata Listserver


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

st: Re: egen rowfirst and rowlast quirks


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: egen rowfirst and rowlast quirks
Date   Mon, 11 Sep 2006 16:01:48 -0400

It does sound like a rounding problem due to precision. How many digits are these numbers? Are you generating doubles or longs? If you have a number that is 24 digits off, I'm wondering how you expect to hold the value accurately using double precision? You should probably type -findit precision- and follow some of those links.

Are these actually numeric values or are they identifiers which could be held as text?

Michael Blasnik
michael.blasnik@verizon.net

----- Original Message ----- From: "Abbe Will" <abbe_will@harvard.edu>
To: "Stata Listserv" <statalist@hsphsun2.harvard.edu>
Sent: Monday, September 11, 2006 3:22 PM
Subject: st: egen rowfirst and rowlast quirks



Hi,
In using the -egen newvar=rowfirst(varlist)- and rowlast commands, I am coming up against a strange quirk where occasionally the value of the new variable is not an exact copy of the first or last value as it should be. Out of 900 observations, about 25 first and last values are created which do not match the actual first and last values exactly. Most of these new values are only one digit higher or lower than the original (sounds like rounding, right?), but a few are 2 digits off, one 11 digits off, one 24.... There seems to be no pattern to which numbers get altered and how. My data are positive integers, so there should be no way to round anyway. I'd greatly appreciate any thoughts or comments. Thanks!

-Abbe Will
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index