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 on April 23, and its replacement, statalist.org is already up and running.


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

RE: st: Same code, same machine, same data, different results


From   "Knee, Alexander" <Alexander.Knee@baystatehealth.org>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Same code, same machine, same data, different results
Date   Thu, 6 Sep 2012 06:29:43 -0400

I've encountered this several times before.  In my case, I had a repeated measures dataset in long form sorted by time.  As it turned out, time was repeated within the same subject therefore every time I ran my code, the data would sort differently and give different results.  I discovered this by running my code until I got two different results and saving the data files.  I then used -cf- to compare the files.  Theoretically (in my mind) my data files should have been exactly the same, but -cf- pointed exactly to where the differences existed and hence my coding error.  This might be a good place to start.

In another case I had a small dataset that I was trying to do too much with.  Again, it came down to how the data was sorted as to whether the model converged or not.


Hope this helps!
Alex 


----
Alex Knee
Research Assistant Professor, Tufts University School of Medicine
Biostatistician, Baystate Medical Center
280 Chestnut St., 3rd Floor
Springfield, MA
Alexander.Knee@baystatehealth.org 
Phone: 413-794-1086
Fax: 413-794-0300


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of David Radwin
Sent: Wednesday, September 05, 2012 5:50 PM
To: statalist@hsphsun2.harvard.edu
Subject: RE: st: Same code, same machine, same data, different results

Mattia,

Is the exact same set of variables being dropped every time?

David
--
David Radwin
Senior Research Associate
MPR Associates, Inc.
2150 Shattuck Ave., Suite 800
Berkeley, CA 94704
Phone: 510-849-4942
Fax: 510-849-0794

www.mprinc.com


> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Joerg Luedicke
> Sent: Wednesday, September 05, 2012 2:24 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: Same code, same machine, same data, different results
> 
> Think of it this way: you have some input (the csv file) which does
> not change, then you execute something (your do-file), and finally use
> -regress- to fit a model. Given that the input is fix, and -regress-
> certainly produces the same results every time it is applied to the
> same data, the problem _must_ lie in your do-file.
> 
> J.
> 
> 
> On Wed, Sep 5, 2012 at 5:10 PM, Mattia Landoni
<mattia.landoni@gmail.com>
> wrote:
> > Dear statalisters,
> >
> > a friend of mine has a bizarre problem. She is running a regression as
> follows:
> >
> > xi: regress a b c i.d i.e
> >
> > and her output is different every time. Has anyone ever seen a
> > behavior like this? Below are some details.
> >
> > Environment:
> > - Stata 11
> > - Windows 32-bit
> >
> > Precise description:
> > The do-file imports several files from .csv, then merges them, then
> > runs the regression. If I run the do-file, I get certain results. If I
> > issue the same regression command again, I get again the same results,
> > as it should be. However, if I re-run the do-file from the beginning,
> > I get slightly different results and the regression even reports a
> > slightly different number of observations. (Say, 2663 vs. 2666). Every
> > time all the data are taken afresh from the same static .csv sources.
> > There is nothing random about the do-file, that I know. The xi:
> > command generates about 200 i-variables and a few, maybe 10, are
> > dropped because of collinearity. There are more than 2500
> > observations.
> >
> > I could post the do-file here, but it's big and messy. If anyone has
> > any insight after reading the above description, I'd be very glad to
> > hear it.
> >
> > Thanks,
> >
> > Mattia
> >
> > --
> > Mattia Landoni
> > +1 217 4-A-QUANT (from US)
> > +39 02 3206 21676 (from Italy)
> > GMT -05:00 (US East)

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

----------------------------------------------------------------------
Please view our annual report at http://baystatehealth.org/annualreport
 

CONFIDENTIALITY NOTICE: This e-mail communication and any attachments may contain confidential and privileged information for the use of the designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its contents is prohibited. If you have received this communication in error, please reply to the sender immediately or by telephone at 413-794-0000 and destroy all copies of this communication and any attachments. For further information regarding Baystate Health's privacy policy, please visit our Internet site at http://baystatehealth.org.

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