Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

RE: st: dropping values


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: dropping values
Date   Tue, 8 Jun 2010 15:29:11 +0100

This is the classic precision problem. -search precision- for FAQs,
articles, etc. and note that Stata struggles to cope with 0.2 as a exact
binary, as well it might. 

. di %23.18f 0.2
   0.200000000000000010

. di %21x 0.2
+1.999999999999aX-003

. di %21x 2
+1.0000000000000X+001

Nick 
n.j.cox@durham.ac.uk 

Svendsgaard.David@epamail.epa.gov

I think there is a problem with dropping values of a variable.

I have a variable named so2conc and it has values 0 .2 .25 .3 .4 .5 .6
1.0
If I use
drop if so2conc==0.2
nothing gets dropped.

If I use
egen so2=group(so2conc)
and then
drop if so2==2
then I get dropped what I need dropped.
I think the problem is that so2conc is stored as a real value.

Has anyone else had this problem or is there something written about
avoiding this problem?

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index