Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: changing number of observations


From   Ronnie Babigumira <rb.glists@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: changing number of observations
Date   Mon, 28 May 2007 16:46:11 +0200

Hard to say without looking at your code. That said, you mention two things that could result in a loss of observations

1. Cleaning. Are you just flagging or dropping suspect cases
2. Merging. -merge- has the option of keeping perfect merges and discarding the stuff that does not merge.

Since you are surprised by the number of observations, I suspect you have not written in anything to reduce the number of observations. I would look at the merge commands (count the observations before and after), or if anything in your code -keep-s or -drop-s stuff



Moore, Jesse wrote:

I have a large do file that I've created to clean a dataset.  It
includes some merging as well as forvalues commands.  The first line of
code is use "filepath", clear

I've run it five times now and each time there has been a different
number of observations at the end (n=7639, 7637, 7645, 7629, and 7641)

It seems that if the do file starts with the same file and does the same
thing every time it should be returning the same observations every
time.  Any ideas on what is happening here?

Thanks.

Jesse Moore, MD
General Surgery Resident
Fletcher Allen Healthcare
University of Vermont
802-847-5097


Confidentiality Notice:
This message, and any attachments, may contain information that is confidential, privileged, and/or protected from disclosure under state and federal laws that deal with the privacy and security of medical information. If you received this message in error or through inappropriate means, please reply to this message to notify the Sender that the message was received by you in error, and then permanently delete this message from all storage media, without forwarding or retaining a copy.

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