Statalist


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

st: AW: -replace- does not create an exact copy


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: -replace- does not create an exact copy
Date   Mon, 26 Oct 2009 08:59:50 +0100

<> 


Try http://www.stata.com/support/faqs/data/float.html




HTH
Martin

-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Michael
McCulloch
Gesendet: Montag, 26. Oktober 2009 02:15
An: Statalist Statalist
Betreff: st: -replace- does not create an exact copy

I mistakenly posted this question as a sub-question in an unrelated  
thread; my apologies.
Here's this issue:

For some reason, the following command:
	. bysort var1 : replace var1 = cond(_n == 1, x, y)

replaces the variable var1 with a number not *exactly* identical, such  
as:
	58.29999924 instead of 58.3.

Although I could say:
	. format %9.2f,

that won't find a match for -if-, as in:
	. ...  if var1==58.3

How should I correct that command?
Michael




Michael McCulloch
Pine Street Foundation
124 Pine Street
San Anselmo, CA 94960-2674
tel:	415-407-1357
fax: 	206-338-2391
[email protected]






*
*   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/


*
*   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/



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