Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: new command -checkfor2-


From   [email protected]
To   [email protected]
Subject   Re: st: new command -checkfor2-
Date   Mon, 19 Sep 2005 14:30:06 -0400

Actually, in real life, I never encounter such a case for missings.
I am using stata 9 up to date and fired up:
. tab rep78,missing

     Repair |
Record 1978 |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |          2        2.70        2.70
          2 |          8       10.81       13.51
          3 |         30       40.54       54.05
          4 |         18       24.32       78.38
          5 |         11       14.86       93.24
          . |          5        6.76      100.00
------------+-----------------------------------
      Total |         74      100.00

Only 5 missings (against 6 in your case) with no differenciation.
Are there different auto data sets?
How to get them.
I tried "ssc inst auto.dta" with no results.

Also, which option is best?
nmissing in checkfor2 (with notification in the help file?).

Many thanks.
Amadou.



                                                                                                                                               
                      Kit Baum <[email protected]>                                                                                                   
                      Sent by:                         To:       [email protected]                                                
                      owner-statalist@hsphsun2.        cc:                                                                                     
                      harvard.edu                      Subject:  st: new command -checkfor2-                                                   
                                                                                                                                               
                                                                                                                                               
                      09/19/2005 02:10 PM                                                                                                      
                      Please respond to                                                                                                        
                      statalist                                                                                                                
                                                                                                                                               
                                                                                                                                               
                                                                                                                                               




Amadou said

Nick, from my point of view, it is easier to type:
nmissing x
than:
count if x == .

Easier, and nmissing (appropriately updated) gives the right answer,
which count does not...

Note that the count statement as given does not tell you how many
missing values there are; it tells you how many are equal to ".".
There are 27 kinds of missing values in Stata, and if you want to
trap all of them,

count if !(x<.)

is needed:

. tab rep78,missing

      Repair |
Record 1978 |      Freq.     Percent        Cum.
------------+-----------------------------------
           1 |          2        2.70        2.70
           2 |          8       10.81       13.51
           3 |         29       39.19       52.70
           4 |         18       24.32       77.03
           5 |         11       14.86       91.89
           . |          4        5.41       97.30
          .a |          1        1.35       98.65
          .b |          1        1.35      100.00
------------+-----------------------------------
       Total |         74      100.00

. count if rep78 == .
     4

. count if !(rep78<.)
     6


Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html


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



*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index