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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: AW: dropping values


From   Svendsgaard.David@epamail.epa.gov
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: AW: dropping values
Date   Tue, 8 Jun 2010 10:53:12 -0400

Thanks Nick and Martin


David J Svendsgaard, PhD
Biostatistician
EPA/ORD/NCEA/RTP, Mail Drop B-243-01
Research Triangle Park, NC 27711
Phone (919) 541-4186
Fax (919) 541-1818


                                                                                             
  From:       "Martin Weiss" <martin.weiss1@gmx.de>                                          
                                                                                             
  To:         <statalist@hsphsun2.harvard.edu>                                               
                                                                                             
  Date:       06/08/2010 10:50 AM                                                            
                                                                                             
  Subject:    st: AW: dropping values                                                        
                                                                                             
  Sent by:    owner-statalist@hsphsun2.harvard.edu                                           
                                                                                             






<>

Just wrap the thing in the -float()- function:

*************
clear*

inp so2conc
0
.2
.25
.3
.4
.5
.6
1.0
end

drop if so2conc==0.2
drop if so2conc==float(0.2)
*************

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



HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von
Svendsgaard.David@epamail.epa.gov
Gesendet: Dienstag, 8. Juni 2010 16:24
An: statalist@hsphsun2.harvard.edu
Betreff: st: dropping values

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?

Thanks,

Dave

David J Svendsgaard, PhD
Biostatistician
EPA/ORD/NCEA/RTP, Mail Drop B-243-01
Research Triangle Park, NC 27711
Phone (919) 541-4186
Fax (919) 541-1818

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



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