Statalist


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

Re: st: stcox output: p-value and CI don't agree


From   Michael McCulloch <[email protected]>
To   [email protected]
Subject   Re: st: stcox output: p-value and CI don't agree
Date   Tue, 7 Aug 2007 22:12:50 -0700

Richard asked:

*--------------- begin code in question -----------------------

*************
* plain cox
*************
* load data and define as survival data
sysuse cancer, clear
stset studytim, failure(died)
* run cox
stcox drug
Could you show us this part of the output using your own data?

------------------------------------------------------------------------------
          _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         tcm |   .7746256   .3025034    -0.65   0.513     .3603167    1.665326
------------------------------------------------------------------------------




Also show the results for

stcox drug, nohr

I believe the z value is based on the coefficient and its standard error, whether nohr is specified or not.
------------------------------------------------------------------------------
          _t |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         tcm |  -.2553755   .3905156    -0.65   0.513    -1.020772    .5100211
------------------------------------------------------------------------------






        * cox
        stcox drug
        indeplist, local
Note that -indeplist- needs to be installed; you can get it from SSC.

* run program
bootstrap drug=r(drug), reps(100): boot_hr
I wonder if there is some bug in Stata here? Even though Stata labels it as the "Observed coefficient" it is indeed the hazard ratio that is being reported. But, unlike the non-bootstrapped results, the z-value seems to be based on the hazard ratio rather than the coefficient. It looks to me like Stata thinks the hazard ratio really is the coefficient and is doing its calculations of z, etc. incorrectly.

In short, my theory is that, when bootstrapping, Stata is getting confused and reporting incorrect results. Alas, the alternative hypothesis, that I am the one getting confused, may be equally plausible. But, the results from the bootstrapped and non-bootstrapped runs do not seem consistent; the labeling of results is different and the calculations of the z values also seem to be different.


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME: (574)289-5227
EMAIL: [email protected]
WWW: http://www.nd.edu/~rwilliam

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