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: Puzzling error with merge


From   Jeph Herrin <[email protected]>
To   [email protected]
Subject   Re: st: Puzzling error with merge
Date   Mon, 13 Jan 2014 16:56:47 -0500

Correct. If you want the missing values to show up using -tabulate-, you need to include the -missing- option:

 tab StudyID, missing

cheers,
Jeph


On 1/13/2014 4:31 PM, Phil Schumm wrote:
On Jan 13, 2014, at 3:11 PM, David Hoaglin <[email protected]> wrote:
On each of those Stata data files, I used -tabulate- with StudyID as a categorical variable (its type is string).  I expected the output to show a frequency of 2 (or more) for any duplicate, but each value of StudyID had a frequency of 1 in both files, and the total frequency was correct in both files.


That is exactly what you would see if you have observations for which StudyID is missing (i.e., they would not appear in the table).  Try

     assert !mi(StudyID)

in both datasets; if this fails, you can either

     count if mi(StudyID)

or examine the data in the Browser.


-- Phil


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


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