Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: RE: drop observations - if statement


From   Richard Williams <[email protected]>
To   [email protected], "[email protected]" <[email protected]>
Subject   Re: st: RE: drop observations - if statement
Date   Wed, 05 Mar 2014 19:23:04 -0500

I don't know, but if so how about

drop if missing(cusip)

Also as Jeph points out, the simplest explanation is that there are no missing data.


At 05:56 PM 3/5/2014, Andrew Maurer wrote:
Are you using an older version of Stata? Didn't you use to have to manually force strings to the appropriate length? Eg count if cusip == " " (10 spaces).

Andrew Maurer

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of R Zhang
Sent: Wednesday, March 05, 2014 4:42 PM
To: [email protected]
Subject: st: drop observations - if statement

Hi all,

I used the following commands to drop observations based on a string
variable - CUSIP- that takes missing values, i.e. delete observations
with missing CUSIP,

drop if cusip==""

cusip is str10

(0 observations deleted)

could you explain why "(0 observations deleted)"?

thanks,

Rochelle
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index