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

From |
Richard Williams <Richard.A.Williams.5@ND.edu> |

To |
statalist@hsphsun2.harvard.edu |

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

Date |
Wed, 08 Aug 2007 00:46:58 -0500 |

At 10:26 PM 8/7/2007, Michael McCulloch wrote:

OK, here are the bootstrapped results using your code:Finally, if you estimated the hazard ratio in -stcox- the header would be "Observed Haz. Ratio", not "Observed coefficient".Thank you Philip, but with all due respect I promise it's the hazard ratio that is returned. The following is the code I used, but for the purpose of this question, applied to the Stata system data file <cancer.dta>. Note that the plain -stcox- and bootstrapped -Cox- have the same effect size, but a different header.

. bootstrap drug=r(drug), reps(100): boot_hr

(running boot_hr on estimation sample)

Bootstrap replications (100)

----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5

.................................................. 50

.................................................. 100

Bootstrap results Number of obs = 48

Replications = 100

command: boot_hr

drug: r(drug)

------------------------------------------------------------------------------

| Observed Bootstrap Normal-based

| Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

drug | .2580584 .0692074 3.73 0.000 .1224144 .3937025

------------------------------------------------------------------------------

The z value = the incorrectly labeled hazard ratio (.2580584) divided by the bootstrap standard error.

Now contrast that with the following:

. set seed 12358

. bootstrap, reps(100): stcox drug

(running stcox on estimation sample)

Bootstrap replications (100)

----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5

.................................................. 50

.................................................. 100

Cox regression -- Breslow method for ties

No. of subjects = 48 Number of obs = 48

No. of failures = 31

Time at risk = 744

Wald chi2(1) = 19.56

Log likelihood = -86.389289 Prob > chi2 = 0.0000

------------------------------------------------------------------------------

| Observed Bootstrap Normal-based

_t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

drug | .2580584 .0790376 -4.42 0.000 .1415839 .4703513

------------------------------------------------------------------------------

Note that (a) the hazard ratio is now labeled correctly, and (b) z does NOT equal the hazard ratio divided by the bootstrap std. error. Finally, consider

. set seed 12358

. bootstrap, reps(100): stcox drug, nohr

(running stcox on estimation sample)

Bootstrap replications (100)

----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5

.................................................. 50

.................................................. 100

Cox regression -- Breslow method for ties

No. of subjects = 48 Number of obs = 48

No. of failures = 31

Time at risk = 744

Wald chi2(1) = 19.56

Log likelihood = -86.389289 Prob > chi2 = 0.0000

------------------------------------------------------------------------------

| Observed Bootstrap Normal-based

_t | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

drug | -1.354569 .306278 -4.42 0.000 -1.954863 -.7542754

------------------------------------------------------------------------------

Here, z does equal observed coefficient/bootstrap std. error.

So again, I think the source of the earlier confusion stems from the fact that Stata was doing things wrong. But, if you use the bootstrap prefix command (which seems a lot simpler anyway) then you get the right results. If you need to do it your way, I strongly suspect StataCorp has to fix some bugs first; unless there is some bug in your program I am overlooking.

-------------------------------------------

Richard Williams, Notre Dame Dept of Sociology

OFFICE: (574)631-6668, (574)631-6463

HOME: (574)289-5227

EMAIL: Richard.A.Williams.5@ND.Edu

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/

**Follow-Ups**:**Re: st: stcox output: p-value and CI don't agree***From:*Michael McCulloch <mm@pinest.org>

**References**:**st: stcox output: p-value and CI don't agree***From:*Michael McCulloch <mm@pinest.org>

**Re: st: stcox output: p-value and CI don't agree***From:*Philip Ryan <philip.ryan@adelaide.edu.au>

**Re: st: stcox output: p-value and CI don't agree***From:*Michael McCulloch <mm@pinest.org>

**Re: st: stcox output: p-value and CI don't agree***From:*Philip Ryan <philip.ryan@adelaide.edu.au>

**Re: st: stcox output: p-value and CI don't agree***From:*Michael McCulloch <mm@pinest.org>

- Prev by Date:
**Re: st: stcox output: p-value and CI don't agree** - Next by Date:
**Re: st: stcox output: p-value and CI don't agree** - Previous by thread:
**Re: st: stcox output: p-value and CI don't agree** - Next by thread:
**Re: st: stcox output: p-value and CI don't agree** - Index(es):

© Copyright 1996–2017 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |