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]

st: RE: Potential bug in Stata 11


From   "Philip Ryan" <philip.ryan@adelaide.edu.au>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Potential bug in Stata 11
Date   Thu, 20 May 2010 07:58:36 +0930

Babak's code also works fine without modification on my system (Stata/SE
v11, latest updates, Windows 64bit).
I note Phil Ender's system is a Mac.  Kieran correctly advised showing us
the result of a -update query- but Babak should also tell us the o/s he is
using. It might be a platform dependent thing.

Phil

Philip Ryan
Professor and Director
Data Management & Analysis Centre
School of Population Health & Clinical Practice
University of Adelaide

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Kieran McCaul
Sent: Thursday, 20 May 2010 7:30 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: Potential bug in Stata 11

....


I ran this on Stata 11 and it worked fine.

If you type -update query- what do you get?



-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Babak Oskooei
Sent: Wednesday, 19 May 2010 10:49 PM
To: Stata List
Subject: st: Potential bug in Stata 11

Dear Stata users,

I have been conducting some simulations in Stata and faced a
computational problem in Stata 11. I run the same code in Stata 9 and it
gives me the right answer. I would be grateful for any feedback on this.
Below, I include the code and the output from both version 9 and version
11. I am simply simulating conditional time-to-event data that are
exponentially distributed with one  normally distributed covariate. Then
I fitt the Cox PH model to the simulated data.

The code I wrote is:

clear
set mem 200m
set obs 10000
set seed 30101  
gen x = uniform()
gen y = invnorm(uniform())
gen eta=y*4.159
gen u=-ln(1-uniform())/0.02   /* exp dist with given hazard */
gen t=exp(-eta)*u
gen d=1

noi{
	stset t, failure(d)
	stcox y, nohr
}

*********************** Here is the output from Stata 11

.         stset t, failure(d)

     failure event:  d != 0 & d < .
obs. time interval:  (0, t]
 exit on or before:  failure

------------------------------------------------------------------------
------
    10000  total obs.
        0  exclusions
------------------------------------------------------------------------
------
    10000  obs. remaining, representing
    10000  failures in single record/single failure data
 1.28e+11  total analysis time at risk, at risk from t =         0
                             earliest observed entry t =         0
                                  last observed exit t =  1.25e+11
.         stcox y, nohr

         failure _d:  d
   analysis time _t:  t

Iteration 0:   log likelihood = -82108.928
Iteration 1:   log likelihood = -71768.287
Iteration 2:   log likelihood = -70067.991
Iteration 3:   log likelihood = -69325.489
Iteration 4:   log likelihood = -68942.115
flat region resulting in a missing likelihood
r(430);
. }
r(430);


*********************** Here is the output from Stata 9


.         stset t, failure(d)

     failure event:  d != 0 & d < .
obs. time interval:  (0, t]
 exit on or before:  failure

------------------------------------------------------------------------
------
    10000  total obs.
        0  exclusions
------------------------------------------------------------------------
------
    10000  obs. remaining, representing
    10000  failures in single record/single failure data
 1.28e+11  total analysis time at risk, at risk from t =         0
                             earliest observed entry t =         0
                                  last observed exit t =  1.25e+11
r; t=0.11 15:37:08
.         stcox y, nohr

         failure _d:  d
   analysis time _t:  t

Iteration 0:   log likelihood = -82108.928
Iteration 1:   log likelihood = -71768.287
Iteration 2:   log likelihood = -70067.991
Iteration 3:   log likelihood = -69325.489
Iteration 4:   log likelihood = -68942.115
Refining estimates:
Iteration 0:   log likelihood = -68932.661
Iteration 1:   log likelihood = -68928.827
Iteration 2:   log likelihood = -68928.826

Cox regression -- no ties

No. of subjects =        10000                     Number of obs   =
10000
No. of failures =        10000
Time at risk    =  1.28362e+11
                                                   LR chi2(1)      =
26360.20
Log likelihood  =   -68928.826                     Prob > chi2     =
0.0000

------------------------------------------------------------------------
------
          _t |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+----------------------------------------------------------
------
           y |   4.183923   .0341413   122.55   0.000     4.117007
4.250838
------------------------------------------------------------------------
------
r; t=0.20 15:37:08
. }
r; t=0.33 15:37:08




***********************



I would be grateful if someone could help me to find out what the
problem is.

Kind regards

Babak Oskooei
MRC Clinical Trial Unit
London



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

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

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.819 / Virus Database: 271.1.1/2882 - Release Date: 05/19/10
15:56:00

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